kureckam Posted November 20, 2009 Share Posted November 20, 2009 I've been searching for a solution but unable to find one, so I'm posting here. I'm using the standard html form layout to upload a file to the server. <link type="text/css" rel="stylesheet" href="../../css/content.css" /> <h2 align="center">Download Data</h2> <br/> <form name="DownloadForm" action="download.php" method="post" enctype="multipart/form-data"> <table> <tr> <td> <input type="hidden" name="MAX_FILE_SIZE" value="10000000" /> Upload File: <input type="file" name="uploadFile" /> </td> </tr> </table> <h1 align="center"><input id="submitButton" type="submit" value="Submit" /></h1> </form> I created a file that has hex values 0x00 to 0xFF. The file is 256 bytes and I uploaded it. The $_FILES["uploadFile"]["size"] displays the size correctly as 256 bytes but when I look at it on the server the size is only 252 bytes. It seems that any hex chars of 0x00 are removed. In addition the chars < (0x3C) = (0x3D) and > (0x3E) are removed. I have found that any information after the < character is removed until it encounters a > character. Can anyone tell me why the file isn't being uploaded in tact? PHP Version = 5.2.10 Apache Version = 2.2.13 Linux Debian Quote Link to comment https://forums.phpfreaks.com/topic/182318-solved-corruption-of-file-on-upload/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 20, 2009 Share Posted November 20, 2009 I look at it on the server How exactly are you doing that? What is your php code that is processing the file? Quote Link to comment https://forums.phpfreaks.com/topic/182318-solved-corruption-of-file-on-upload/#findComment-962120 Share on other sites More sharing options...
kureckam Posted November 20, 2009 Author Share Posted November 20, 2009 I'm not using code to look at it. I'm looking at it on the server via the console. Quote Link to comment https://forums.phpfreaks.com/topic/182318-solved-corruption-of-file-on-upload/#findComment-962146 Share on other sites More sharing options...
kureckam Posted November 20, 2009 Author Share Posted November 20, 2009 My apologies for wasting everyone's time. I found the problem. I had copied some to do the upload and as part of it they were reformting the file by using strip_tags. I removed that code and it works fine. Quote Link to comment https://forums.phpfreaks.com/topic/182318-solved-corruption-of-file-on-upload/#findComment-962158 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.