Re: http upload corrupts my file on apache and Win XP
| From: | Mathias B | Date: | Fri, 12 Jul 2002 09:44:53 +0000 |
| Subject: | Re: http upload corrupts my file on apache and Win XP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-107337@lists.php.net to get a copy of this message | ||
FYI: i solved the problem myself by simply installing Apache 2.0.39 instead
of 2.0.36, and then downloading the appropriate php4apache2.dll from php.net
(http://www.php.net/manual/en/install.apache.php)
Hope it helps someone else...
Mathias
"Mathias B" <mathiasb@email.dk> wrote in message
news:20020708120504.63279.qmail@pb1.pair.com...
> Hello
>
> I use: Apache 2.0.36 and PHP 4.2.1 on WinXP
>
> I have major problems when trying to upload files with the following code:
>
> HTML code:
>
> <form name="theForm" method="post" action="../Doc_List/"
> ENCTYPE="multipart/form-data">
> <input type="file" name="data" size="25">
> <input type="submit" name="Action" value="<?
> echo(__("Add")); ?>">
> </form>
>
> Going to the PHP handler:
>
> if (is_uploaded_file($data))
> {
> $realname = $_FILES['data']['name'];
>
> echo "data: $data
> run:".move_uploaded_file($_FILES['data']['tmp_name'],
> "c:\\windows\\temp\\php\\".$realname);
> }
>
> The program prints: data: C:\WINDOWS\TEMP\php19C.tmp run:1
> Everything goes fine if it is just a small text file. And everything seems
> to also go fine for larger binary files (e.g. a word document), the
document
> gets copied to the temp directory. The problem is just that the file gets
> completely scrambled on the way. The file almost doubles in size and the
> binary data is not the same at all. seems like there is put some kind of
> formatting in on the way. (Looks like it gets alot of \0 instead of NULL
> bytes everywhere like some others on this group and on php.net has
> experienced, but i just can't get it solved...)
>
> I have these set in the php.ini file
>
> magic_quotes_gpc = Off
> magic_quotes_runtime = Off
> magic_quotes_sybase = Off
>
> Please Help... :)
>
> /Mathias Bertelsen
>
>
>