astralaaron Posted May 19, 2007 Share Posted May 19, 2007 has anyone read the upload php tutorial here on w3schools? will that code work to upload videos that are pretty big into folders on the server?is there a way to display the upload progress? Link to comment Share on other sites More sharing options...
zppblood Posted May 19, 2007 Share Posted May 19, 2007 I don't know about the second question (haven't checked the script). I believe you will need something like AJAX to show the progress. Link to comment Share on other sites More sharing options...
Anders Moen Posted May 19, 2007 Share Posted May 19, 2007 I just want to tell you that the movies would take a lot of your bandwidth (and I mean a lot) + it would take several hours before the movie had been uploaded. Maybe that's why you want that AJAX script Link to comment Share on other sites More sharing options...
astralaaron Posted May 19, 2007 Author Share Posted May 19, 2007 I just want to tell you that the movies would take a lot of your bandwidth (and I mean a lot) + it would take several hours before the movie had been uploaded. Maybe that's why you want that AJAX script yeah the bandwidth doesnt matter, this is what they want.. I need to be able to upload WMV atleast 10 MB Link to comment Share on other sites More sharing options...
astralaaron Posted May 19, 2007 Author Share Posted May 19, 2007 in my php.ini file it is set like this; Whether to allow HTTP file uploads.file_uploads = On; Temporary directory for HTTP uploaded files (will use system default if not; specified).upload_tmp_dir = "C:/wamp/tmp"; Maximum allowed size for uploaded files.upload_max_filesize = 20Mwhen I upload a file that is 800kb it works fine.. when I try to upload one that is 11.1MB it is an error..why? Link to comment Share on other sites More sharing options...
Anders Moen Posted May 20, 2007 Share Posted May 20, 2007 Are you sure it isn't bigger than 20MB? Try to raise the limit more... Link to comment Share on other sites More sharing options...
justsomeguy Posted May 21, 2007 Share Posted May 21, 2007 The web server also has a maximum limit on the size of a request, independent of PHP. IIS6 stores that in a file called metabase.xml, I don't know how Apache is set up. Make sure you are also using the hidden form input to say what the max filesize is, it won't work correctly without that.There's no way to show a progress bar with an upload because the web server doesn't know how big the file is. The web server might know that you have uploaded 500kb so far, but it doesn't know what the total will be so it doesn't know what percentage complete it is. Link to comment Share on other sites More sharing options...
astralaaron Posted May 22, 2007 Author Share Posted May 22, 2007 The web server also has a maximum limit on the size of a request, independent of PHP. IIS6 stores that in a file called metabase.xml, I don't know how Apache is set up. Make sure you are also using the hidden form input to say what the max filesize is, it won't work correctly without that.There's no way to show a progress bar with an upload because the web server doesn't know how big the file is. The web server might know that you have uploaded 500kb so far, but it doesn't know what the total will be so it doesn't know what percentage complete it is.thx Link to comment Share on other sites More sharing options...
jesh Posted May 22, 2007 Share Posted May 22, 2007 There's no way to show a progress bar with an upload because the web server doesn't know how big the file is. The web server might know that you have uploaded 500kb so far, but it doesn't know what the total will be so it doesn't know what percentage complete it is.This is possible in .NET as long as you can trust that the browser will be sending you an accurate Content-Length in the Request header. I don't know about PHP, but in .NET you can hook into the BeforeRequest event which fires before the Request is processed. At this point, you can look at all the Request headers - including the Content-Length - to see if you want to continue processing the request or if you want to reject or redirect it. If you could latch into something like this in PHP, you would have the (supposed) Content-Length without having to wait for the entire Request to finish processing. If you stored that data into a session variable, you'd be able to ping the server using AJAX to see how far along you are in the upload.The major hurdle here, I believe, is whether or not you can execute code before the Request is processed in PHP. If you can't then, yes, a progress bar would be impossible. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 22, 2007 Share Posted May 22, 2007 Yeah, that's a good point. I don't think that the current versions of PHP can do anything before the request gets processed, it is my understanding that the web server receives the entire request (including the uploaded file) and then fires up PHP. We might see future versions of PHP try to hook deeper into the server, but I don't think anything like that is available right now. Link to comment Share on other sites More sharing options...
reportingsjr Posted May 23, 2007 Share Posted May 23, 2007 I thought you could with cakePHP or zend. I know its possible because I've seen it many, many times. Try googling for this: "PHP upload progress bar". Hopefully that will return something. Link to comment Share on other sites More sharing options...
astralaaron Posted May 23, 2007 Author Share Posted May 23, 2007 ill do that search but that really isnt a big deal, was just wondering :-) dont actually need it Link to comment Share on other sites More sharing options...
reportingsjr Posted May 23, 2007 Share Posted May 23, 2007 Maybe you should consider using ftp to upload it? Just check for file type and such, then upload it through ftp. Link to comment Share on other sites More sharing options...
astralaaron Posted May 24, 2007 Author Share Posted May 24, 2007 Maybe you should consider using ftp to upload it? Just check for file type and such, then upload it through ftp.wait what do you mean?this is for the admin of the website to upload them so I dont have to do it each time Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.