0

My website contains a section for users to upload photo albums with up to 1000 photos. Currently, my PHP upload script keeps crashing despite my removing filesize and upload limits from the PHP.ini (I have just about removed all restrictions against file uploading). How would you suggest going about uploading this many files? I am currently just passing the $_FILES array then using the move_uploaded_file function. Would FTP allow me to upload smoother without interruptions, or should I use a new language all together? These are the errors that I am receiving: The connection was reset

The connection to the server was reset while the page was loading. The site could be temporarily unavailable or too busy. Try again in a few moments. If you are unable to load any pages, check your computer's network connection. If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.

--and--

Request Entity Too Large The requested resource /index.html/uploadAnAlbum.php does not allow request data with GET requests, or the amount of data provided in the request exceeds the capacity limit. Additionally, a 413 Request Entity Too Large error was encountered while trying to use an ErrorDocument to handle the request.

Thanks

  • 1
    Suggestion if noone else can come up with anything; would it be possible to use JS and AJAX to upload in smaller chunks? – Luke Oct 02 '15 at 23:43
  • Good idea. Would you be able to detail a short description of how this would work and the languages used if you get a chance? Thanks – TasParts Oct 02 '15 at 23:45
  • I'll look, I've never done it. Also see if this helps: http://stackoverflow.com/questions/7574260/php-connection-reset-on-large-file-upload-regardless-correct-setting – Luke Oct 02 '15 at 23:51
  • As for the split, follow along with this guide here: http://blog.teamtreehouse.com/uploading-files-ajax . Essentially, you'd create the FormData and HttpRequest object multiple times within a loop for various file counts. Happy to write a bit more if required? – Luke Oct 02 '15 at 23:54
  • That should be enough. Thank you for the help Luke! – TasParts Oct 03 '15 at 00:03
  • I suggest to bundle those files first into local archive so you would just need to upload **1** file instead of 1000, then just extract it from the server if necessary. – mr5 Oct 03 '15 at 02:03
  • Can you elaborate a bit more? I am not familiar with 'bundling' files. Thank you – TasParts Oct 03 '15 at 03:02

0 Answers0