Cheating MAX_UPLOAD_SIZE
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
Cheating MAX_UPLOAD_SIZE
Ok I want people to have the ability to upload large files to my server. Right now of course we are restricted to 30 seconds execution and 2 megs upload. Well this is poopy!
I was wondering if there was a way to use some AJAX to kind of split a file up and send it chunk by chunk and reassemble it on the server, kinda like a rar style thing. This could be done slowly if needed to keep the 30 seconds time and even work around the 2 megs limit by breaking it into 2 meg chunks. But, is this even possible? Where would I start? Any other ideas for this, maybe using things like the ftp functions or whatever? All files that will be uploaded are trusted 100% no questions asked.
I was wondering if there was a way to use some AJAX to kind of split a file up and send it chunk by chunk and reassemble it on the server, kinda like a rar style thing. This could be done slowly if needed to keep the 30 seconds time and even work around the 2 megs limit by breaking it into 2 meg chunks. But, is this even possible? Where would I start? Any other ideas for this, maybe using things like the ftp functions or whatever? All files that will be uploaded are trusted 100% no questions asked.
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
As far as I can see, JavaScript offers no facilities for the memory-expensive chunking procedure you describe. Heck, I don't think it would even be able to read the file.
In this case, I would strongly recommend setting FTP accounts for these people into some temporary directory. Upload via FTP, then do your stuff. SourceForge has a mechanism like this for uploading new releases (although, admittedly, it's more complicated than it should be).
In this case, I would strongly recommend setting FTP accounts for these people into some temporary directory. Upload via FTP, then do your stuff. SourceForge has a mechanism like this for uploading new releases (although, admittedly, it's more complicated than it should be).
I'd probably look for a Java applet.. And then look for some zip (or other archive) library to do the splittings... And start uploading...
(eg: http://www.javazoom.net/applets/jclient ... _http.html)
(eg: http://www.javazoom.net/applets/jclient ... _http.html)
-
kingconnections
- Forum Contributor
- Posts: 137
- Joined: Thu Jul 14, 2005 4:28 pm
Not sure about the upload limit, but I have used this for long scripts that blow past the 30 sec run time.
set_time_limit -- Limits the maximum execution time
http://us2.php.net/manual/en/function.s ... -limit.php
set_time_limit -- Limits the maximum execution time
http://us2.php.net/manual/en/function.s ... -limit.php
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Unfortunately, maximum execution time doesn't affect PHP's processing during the upload itself, which is set by a different directive. Specifically, max_input_time.
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
this sounds great. let me be sure im understanding, i could write a java applet that could upload any size file, even without breaking it up right? If so, would there be a way to limits its bandwidth usage?timvw wrote:I'd probably look for a Java applet.. And then look for some zip (or other archive) library to do the splittings... And start uploading...
(eg: http://www.javazoom.net/applets/jclient ... _http.html)
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
so java can only use some php script to upload the file? so maybe i could use java to get the file and break it up then upload the chunk to the server through php? i dont know much about java so before i start learning it to do this i would like to make sure its possible first.timvw wrote:if your (php) script has a 2mb limit... you will have to do it in 2mb chunks... no way to get round that limitation... (apart from removing/altering the limitation itself)