php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16161 Uploaded file corrupted
Submitted: 2002-03-19 00:45 UTC Modified: 2002-03-19 04:20 UTC
From: adeshner at mail dot dvo dot ru Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.1.2 OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: adeshner at mail dot dvo dot ru
New email:
PHP Version: OS:

 

 [2002-03-19 00:45 UTC] adeshner at mail dot dvo dot ru
I have PHP 4.1.2 (binary distribution from www.php.net) and Apache/1.3.22 Server running under Windows NT 5.0 build 2195 (Windows 2000). I have a problem:
uploaded files seem to be corrupted, namely, all bytes with values '0x0' in original file are changed to values '0x20' in uploaded one, so only binary files are corrupted, text files are OK.

Form used:

<form method="POST" action="./upload.php" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="65536">
<input name="uploadfile" type="file" size="40">
<br><br>
<input type="submit" value="Send">

The script is:

$tmpname=preg_replace("/\\\/", "/", $_REQUEST["uploadfile"]["tmp_name"]);
preg_match("/\..*/", $_REQUEST["uploadfile"]["name"], $match);
copy($tmpname, $tmpname . $match[0]);

Thanks for any help.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-19 04:20 UTC] sander@php.net
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php


 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jul 30 08:01:24 2021 UTC