Answer the question
In order to leave comments, you need to log in
PHP: how to get file from download link?
Conditions . There is an api - it works on GET requests. Returns a file in XML/JSON format and the like (the file is downloaded automatically when you click on the url).
Task . Or open the file in a PHP script instead of downloading (ala file_get_contents or curl - it doesn't matter). Or, if the first option is not possible, then save this file to disk - I will continue to parse the file.
In principle, you can not chew too much - just tell me where to dig. A search in the PHP manual did not lead to success - either I was looking in the wrong place, or I was looking for the wrong thing, or "the skis don't go" - it's been almost a day behind the monitor. Thank you!
Answer the question
In order to leave comments, you need to log in
Basically "file upload" is just a custom HTTP header filename=...
Try
system('wget url -O filename');
file_get_contents(filename);
perhaps the server checks the authorization/referer headers, etc., because of this it does not give the file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question