How can I use the MIME protocol and form to download files on my iphone?

Source: Internet
Author: User
I developed a tool for downloading music websites online. it was written in PHP and contains the Content-type & amp; Content-Disposition in the MIME protocol. after testing the computer, Android can download it normally, the code is as follows (for testing, the code layout is messy and you may want to bear with me): MP3 files are stored in Notepad...

I made a tool for downloading music websites online. I wrote it in PHP, including Content-type & Content-Disposition in the MIME protocol. I tested my computer and Android can download it normally, code ):

MP3 files are opened in the browser and directly parsed and played by the browser. the online tool is used to obtain links from a website (MP3 format) after the MIME protocol forced browser to download MP3 files instead of playing online, assuming good site address: http://www.w00yun.top/echo.php

In this way, you can directly download MP3 files by entering the link and test the MP3 files on multiple browsers on your computer and Android. However, you can download the MP3 files directly using the Safari browser that comes with your iphone:

It's just a PHP enthusiast who has never studied programming or programming. Baidu later learned that the browser of the iphone cannot download anything at will, you can use the QQ browser under the iphone to download the file, but the downloaded file size is obviously incorrect:

In this way, I started to test what went wrong. on oschina via Google, I saw that the style of the form submission button was invalid on Safari.

I thought it was a form submission question, but I found that it was not the answer I wanted by checking the answer, and through testing, if the MIME protocol is commented out, the download link obtained through the form submission and output is normal.

The reason for this is not the form. then, I directly assigned the link to the variable and found that the link can be downloaded normally through the MIME protocol. The song size can also be played normally:

In this way, both the download link and the MIME protocol can be directly downloaded in the iphone's QQ browser. However, normal files cannot be downloaded after the link is extracted from the form and downloaded through MIME, I don't know what the problem is. I hope you can help me solve it. thank you!

Reply content:

I made a tool for downloading music websites online. I wrote it in PHP, including Content-type & Content-Disposition in the MIME protocol. I tested my computer and Android can download it normally, code ):

MP3 files are opened in the browser and directly parsed and played by the browser. the online tool is used to obtain links from a website (MP3 format) after the MIME protocol forced browser to download MP3 files instead of playing online, assuming good site address: http://www.w00yun.top/echo.php

In this way, you can directly download MP3 files by entering the link and test the MP3 files on multiple browsers on your computer and Android. However, you can download the MP3 files directly using the Safari browser that comes with your iphone:

It's just a PHP enthusiast who has never studied programming or programming. Baidu later learned that the browser of the iphone cannot download anything at will, you can use the QQ browser under the iphone to download the file, but the downloaded file size is obviously incorrect:

In this way, I started to test what went wrong. on oschina via Google, I saw that the style of the form submission button was invalid on Safari.

I thought it was a form submission question, but I found that it was not the answer I wanted by checking the answer, and through testing, if the MIME protocol is commented out, the download link obtained through the form submission and output is normal.

The reason for this is not the form. then, I directly assigned the link to the variable and found that the link can be downloaded normally through the MIME protocol. The song size can also be played normally:

In this way, both the download link and the MIME protocol can be directly downloaded in the iphone's QQ browser. However, normal files cannot be downloaded after the link is extracted from the form and downloaded through MIME, I don't know what the problem is. I hope you can help me solve it. thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.