Ask the question about forced download of header

Source: Internet
Author: User
Tags php download
Ask a newbie about the mandatory download of the header. I have been studying for a long time and don't know how to solve it. please ask your predecessors to answer this question.

 


Error message: readfile (http://tsmusic24.tc.QQ.com/105588684.mp3): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request

The browser can access the link normally, but cannot forcibly download the link using the header. try curl access and get the 400 status code.


Reply to discussion (solution)

I tried it. yes, no matter local or official domain name. Is it a configuration problem?

I tried it. yes, no matter local or official domain name. Is it a configuration problem?



Can I post some of your function code? I tried not to run properly both locally and on the server.

You have downloaded the MP3 file directly by running your code locally.


I tried it. yes, no matter local or official domain name. Is it a configuration problem?



Can I post some of your function code? I tried not to run properly both locally and on the server.

No part of the code can be downloaded by directly copying the code. you do not need to check the code and start with other problems. for example, if some function libraries on the server are not available, or php Download Configuration, etc.

You have downloaded the MP3 file directly by running your code locally.


That is to say, what is the complete mp3 file downloaded?

Don't talk nonsense on the upstairs! Is this download?

Which of the following 203 bytes is MP3?



I tried it. yes, no matter local or official domain name. Is it a configuration problem?



Can I post some of your function code? I tried not to run properly both locally and on the server.

No part of the code can be downloaded by directly copying the code. you do not need to check the code and start with other problems. for example, if some function libraries on the server are not available, or php Download Configuration, etc.


That is to say, is the downloaded mp3 file full size?

Don't talk nonsense on the upstairs! Is this download?

Which of the following 203 bytes is MP3?


Open the link in the browser, and the resulting music file is complete (on M), and the header is forcibly downloaded to get an error message (203b)

You can use the text editor to open the downloaded titleworkflow and you will see some error messages.
Correct errors can be obtained.

$file = 'http://tsmusic24.tc.QQ.com/105588684.mp3';readfile($file);


Warning: Readfile (http://tsmusic24.tc.QQ.com/105588684.mp3): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
In .....

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.