Download files truncate the first letter

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

I have an html form that uploads files to a 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 cuts off the first letter for no reason that I see. I do not know if the IIS setting or the PHP setting is installed.
Exit:

 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, the same code, the 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 ) ) 
+7
source share
2 answers

It looks like the error you are facing $ _ FILES 'name' missing the first character after loading.

I have the same problem.

+5
source

I had the same problem and searched a lot, but this is a mistake, and I don’t know why! But I have a solution, and it works. Just the name prefix before the file name. Example:

 'fileNamePrefix_' . $_FILES['file_name_attribute']['name'] 
+1
source

All Articles