#19205 [Opn->Bgs]: File upload results in an empty file

From: Date: Tue, 03 Sep 2002 23:18:28 +0000
Subject: #19205 [Opn->Bgs]: File upload results in an empty file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18355@lists.php.net to get a copy of this message
ID: 19205 Updated by: sniper@php.net Reported By: dreamcaster@microdreams.com -Status: Open +Status: Bogus Bug Type: Output Control Operating System: Unix PHP Version: 4CVS-2002-08-30 New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. First of all, 4.0.4pl1 is really too old..and has some security exploits too. And it's upload code really is buggy, so you should get it updated. Previous Comments: ------------------------------------------------------------------------ [2002-08-30 18:35:41] dreamcaster@microdreams.com When I use php to perform a file upload, it results in an empty file being placed on the server. The file name is right, the file extension is right, but the file is simply empty. Calling up the image in a browser yields a broken image. My server is running php 4.0.4pl1 and for certain reasons out of my control, I cannot upgrade it. Is this a known problem for this build? Please let me know. If this is the case, then I will be able to convince the admins that they need to upgrade to a later build. Code: function do_upload($filename,$newname) { $file = basename($filename); $tmp_upload_path = "/tmp/"; $new_file_name = "/aa/cvsro/tltc/funding/proposals/" . $newname; if (!copy($tmp_upload_path.$file, $new_file_name)) echo "failed to copy file<br>\n"; return; } Thanks! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19205&edit=1

« previous php.bugs (#18355) next »