Re: Re: Upload problem - final size is different
| From: | Daniel Brown | Date: | Tue, 08 May 2007 22:03:33 +0000 |
| Subject: | Re: Re: Upload problem - final size is different | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254602@lists.php.net to get a copy of this message | ||
Eric,
If you're checking the filesize via FTP, a web-based file manager, or
even the shell if it's a cross-platform upload, it can give bad data. Try
downloading the file and seeing if it's still working. If it does, try
uploading it via FTP and having a script check the md5 hash on the two files
while still on the server.
Other possibilities could include:
* Settings in php.ini for upload_max_filesize or max_execution_time,
max_input_time, or memory_limit, among others.
* Out of disk space on the partition you're saving to, or the /tmp
partition (or wherever PHP is set to write to).
* A trojan horse or virus on the server side that may be infecting the
files upon upload.
On 5/8/07, itoctopus <newsgroup@itoctopus.com> wrote:
Have you tried your code on another server? -- itoctopus - http://www.itoctopus.com "Eric Trahan" <eric.trahan@sc.ca> wrote in message news:1A25BD70-BF03-43C6-8FCB-6A49B34C968D@sc.ca... Hi, I have a form to upload file on my web server, so user can upload their images. The upload work. The user file is uploaded to my destination folder (page5/) but the file is unreadable and the file size is smaller than the original file size. I run Apache with PHP 4.1.2. Thank you, Eric. Here is the form code: <form enctype="multipart/form-data" action="fileupload_bd.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Une image<br/><input type="file" name="uneimage" /> <br/><br/>Du texte: <input type="text" name="untexte" /> <br/><br/><input type="submit" /> </form> Here is my PHP upload code: <?php echo $_POST['untexte'] . "<br/><br/>"; $tmp_name = $_FILES['uneimage']['tmp_name']; $type = $_FILES['uneimage']['type']; $name = $_FILES['uneimage']['name']; $size = $_FILES['uneimage']['size']; echo $tmp_name . "<br/>" . $type . "<br/>" . $name . "<br/>"; $target_path = "page5/"; $target_path = $target_path . basename( $_FILES['uneimage']['name']); echo $target_path; if(move_uploaded_file($_FILES['uneimage']['tmp_name'], $target_path)) {-- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107echo "The file ". basename( $_FILES['uneimage']['name']). " has been uploaded";} else{echo "There was an error uploading the file, please try again!";} ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php