From: [EMAIL PROTECTED]
Operating system: WinXP
PHP version: 4.1.0
PHP Bug Type: Filesystem function related
Bug description: HTTP Upload files missing few bytes from end
I have some scripts used to upload gifs. The form has the right enctype,
and the script looks like:
==
list($filename, $fileext) = explode(".", basename($upfile_name));
$file = $filename . '.' . $fileext;
if (file_exists($DOCUMENT_ROOT . '/dbimages/' . $file)) {
$i = 0;
while(file_exists($DOCUMENT_ROOT . '/dbimages/' . $file)) {
$i++;
$file = $filename . '(' . $i . ').' . $fileext;
}
}
$rfp = fopen($upfile, 'r');
$wfp = fopen($DOCUMENT_ROOT . '/dbimages/' . $file, 'w');
fwrite($wfp, fread($rfp, filesize($upfile)));
fclose($wfp);
fclose($rfp);
==
But the uploaded file is missing a few bytes. Check out the screenshot
below. It's only about 5 bytes missing, but that doesn't help a browser
trying to render the image.
I downloaded a windows binary about 2 weeks ago and installed it on
winxp/apache. If you need any other info, just ask.
http://customfones.com/temp/php_upload.GIF
--
Edit bug report at: http://bugs.php.net/?id=14390&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]