|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-12-09 10:53 UTC] sander@php.net
[2001-12-09 11:02 UTC] dannytuppeny at ntlworld dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 10:00:02 2025 UTC |
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