Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Files being uploaded get the first letter cut off

Tags:

html

php

iis

I'm migrating a website from a server with WS2003, IIS6, PHP 5.2 over to a server with WS2008, IIS7 and PHP 5.3

I have a html form that uploads files to the site.

<?php
if(isset($_POST["Upload"])){
    echo "<pre>";
    print_r($_POST);
    print_r($_FILES);
    echo "</pre>";
}
?>

<form action="tester.php" method="post" enctype="multipart/form-data">
    <input type="hidden" name="Upload" value="1" />
    <input type="hidden" name="MAX_FILE_SIZE" value="4500000" />
    <input type="file" name="artImage" id="artImage" />
    <input type="submit" />
</form>

Works great on the old server, but on the new server, it chops off the first letter for no reason I can see. I don't know if it's an IIS setting, or a PHP setting.
Output:

Array
(
    [Upload] => 1
    [MAX_FILE_SIZE] => 4500000
)
Array
(
    [artImage] => Array
        (
            [name] => easons_Change_(HD_Ready).jpg
            [type] => image/pjpeg
            [tmp_name] => C:\Windows\Temp\php99.tmp
            [error] => 0
            [size] => 498879
        )

)

Output from the old server, same code, same file:

Array
(
    [Upload] => 1
    [MAX_FILE_SIZE] => 4500000
)
Array
(
    [artImage] => Array
        (
            [name] => Seasons_Change_(HD_Ready).jpg
            [type] => image/pjpeg
            [tmp_name] => C:\WINDOWS\Temp\php6835.tmp
            [error] => 0
            [size] => 498879
        )

)
like image 993
AndyD273 Avatar asked Nov 17 '11 19:11

AndyD273


1 Answers

This looks like the bug you are experiencing $_FILES 'name' missing first character after upload.

I am having the same issue.

like image 62
cosmoba Avatar answered Sep 23 '22 01:09

cosmoba