Problem Next: Server Through the APIs gets files from another server by "order" of the client, downloads it yourself and then gives them to the client.
Question: Is it possible (if so, how) to remove the link in this chain, where the intermediary server first pumps itself, and then gives it to the client? That is, that the server is only authorized, got a token, and the client with a token downloaded himself directly through the browser.
Schema of receiving a file is such:
$ respjwt= $ this-> get_cookies (); //Tocken $ url= 'https://app.ru/api/documents/'.$doc_id.'/file'; $ ch= curl_init ($ URL); CURL_SETOPT ($ CH, CURLOPT_HTTPGET, TRUE); CURL_SETOPT ($ CH, CURLOPT_RETURNTRANSFER, TRUE); CURL_SETOPT ($ CH, Curlopt_Httpheader, Array ($ Respjwt)); CURL_SETOPT ($ CH, CURLOPT_VERBOSE, TRUE); $ FP= Fopen ($ Name, 'W'); curl_setopt ($ CH, Curlopt_file, $ Fp); $ Data= CURL_EXEC ($ CH); CURL_CLOSE ($ CH);
and then the server redirects to the download page of this $ name file to the download page.
- AMOCRM PHP API Why is an empty query body go?
- php : Is it safe to use CURL for proxing?
- php : Where is the error when processing API?
- php : How to install guzzle headers
- php : WP REST API WP Rest Response returns dual quotes (one character) instead of NULL when calling a class method
- How to get comments with YouTube on PHP
- php : Hello, I have such a question respected programmers. It is impossible to go according to the links to mate info