Home >Backend Development >PHP Tutorial >PHP implements uploading binary files in text mode

PHP implements uploading binary files in text mode

WBOY
WBOYOriginal
2016-08-08 09:33:421710browse

Now when some sites upload files, they will automatically add headers such as Content-type: image/gif in front of the file, causing the binary file to be damaged. So I wrote a php program to upload binary files as text.
There are two files in total: index.php, action.php. Change the file name of the file to be uploaded to test, put it together with these two files, run index.php, select read, copy all the data read, also run this program on the remote server, Paste to input box, select Save. The binary file is uploaded.

index.php
-------------------------------------------------- -------


PHP program to upload binary files in text format








         
Image upload







​​​

                           

                
                                                                                                                    
Save

Try it out
            
Read

            
                                                    
                                                                                         



-------------------------------------------------- -------

action.php
-------------------------------------------------- -------

The above introduces the PHP implementation of uploading binary files in text mode, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn