When a file is uploaded to a website, the Content-type: image/gif header is automatically added before the file, causing damage to the binary file. Therefore, I have compiled a PHP program for uploading binary files in text mode.
There are two files in total: index. php and action. php. Change the file name to test. Put the two files together and run index. php, select read, Copy all the data read, run this program on the remote server, Paste to the input box, and choose Save. The binary file is uploaded.
Index. php
---------------------------------------------------------
<Html>
<Head>
<Title> PHP program for uploading binary files as text </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
</Head>
<Body bgcolor = "# FFFFFF">
<Table width = "760" border = "0" cellspacing = "0" cellpadding = "0" height = "25">
<Tr>
<Td>
<Div align = "center"> <B> upload images </B> </div>
</Td>
</Tr>
</Table>
<Table width = "760" border = "0" cellspacing = "0" cellpadding = "0">
<Tr>
<Td>
<Form name = "form" method = "post" action = "action. php" target = "_ blank">
<Div align = "center">
<Textarea name = "pic" cols = "80" rows = "15"> </textarea>
<Br>
<Input type = "radio" name = "view" value = "0" checked>
Save
<Input type = "radio" name = "view" value = "1">
Bytes
<Input type = "radio" name = "view" value = "2">
Read <br>
<Input type = "submit" name = "OK" value = "OK">
<Input type = "reset" name = "RESET" value = "Remove">
</Div>
</Form>
</Td>
</Tr>
</Table>
</Body>
</Html>
---------------------------------------------------------
Action. php
---------------------------------------------------------
<?