Upload script hangs on large files - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Upload script hangs on large files

locodudelocodude Posts: 28Member
I have an upload script that receives an imagefile, performs a bit of magic on it (some GD-functions) and then stores it on the server.
The script works fine with images up to around 150Kb in size but when I try to upload really big images (like hi-res pics from my digicam, from 600Kb to 3Mb in size) the script seems to hang and then crash. It does however on most occasions still work, although it hangs at the end of the script it seems, but the file is still uploaded, altered and stored in the correct folder. It just never reaches the final part of the script (which is some HTML-output).
I have no idea what's wrong. Does anybody know if there's some sort of upper limit to the size of a file that can be uploaded via PHP? I'm using the copy()-function to upload the file btw.
----
"codito, ergo sum"

Comments

  • tvientitvienti Posts: 230Member
    Hm.. I don't have too much experience with this, but I may as well offer some insight while we wait for someone to provide a more likely solution.

    Have you checked upload_max_filesize in php.ini? You made it sound like the issue is inconsistent, even with larger files, so this is most likely not the issue. Also, if you haven't already, you may want to litter your script with writes to a log file (not stdout) before and after each step, to see where exactly it's hanging. I find it odd that it would receive, manipulate, and store the file fine, only to crash on the easy part of the HTML output. I can't really speculate as to why it would do this..

    Sorry I can't be of more help =/
    T



    : I have an upload script that receives an imagefile, performs a bit of magic on it (some GD-functions) and then stores it on the server.
    : The script works fine with images up to around 150Kb in size but when I try to upload really big images (like hi-res pics from my digicam, from 600Kb to 3Mb in size) the script seems to hang and then crash. It does however on most occasions still work, although it hangs at the end of the script it seems, but the file is still uploaded, altered and stored in the correct folder. It just never reaches the final part of the script (which is some HTML-output).
    : I have no idea what's wrong. Does anybody know if there's some sort of upper limit to the size of a file that can be uploaded via PHP? I'm using the copy()-function to upload the file btw.
    : ----
    : "codito, ergo sum"
    :

Sign In or Register to comment.