The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Upload Script Question (bug in PHP)?

Discussion in 'General Discussion' started by bigj, Oct 6, 2005.

  1. bigj

    bigj Well-Known Member

    Aug 9, 2003
    Likes Received:
    Trophy Points:
    This may be a bit OT for this forum but wanted to drop a line here before I pursued other avenues. I have a PHP script that allows files to be uploaded to one of my Cpanel servers.

    PHP takes the file drops it in /tmp (the temp upload directory) my script grabs that file, copies it to the original filename and places it in my requested directory. If I'm fast enough I can grab a directory listing and see the file and that it's of the correct size. If I wait one second and refresh that directory the file is now emtpy. Zero bytes in size.

    PHP has now just zero'd out a file. Why? I can tell the script to leave it in /tmp and copy it to the uploaded filename and it doesn't zero it out. So it only does it if I try and copy it to another directory other than /tmp.

    I've tested the same script on another server (non Cpanel) and it works just fine with the same version of PHP, 4.4.0.

    Any help would be appreciated. Thanks.


Share This Page