#19205 [NEW]: File upload results in an empty file
| From: | dreamcaster at microdreams dot com | Date: | Fri, 30 Aug 2002 22:35:42 +0000 |
| Subject: | #19205 [NEW]: File upload results in an empty file | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-18295@lists.php.net to get a copy of this message | ||
From: dreamcaster@microdreams.com
Operating system: Unix
PHP version: 4CVS-2002-08-30
PHP Bug Type: Output Control
Bug description: File upload results in an empty file
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 bug report at http://bugs.php.net/?id=19205&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19205&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19205&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19205&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19205&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19205&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19205&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19205&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19205&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19205&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19205&r=globals