I want to download a PDF file from our File Storage.
But I get following error message while using file_get_contents()
Warning: file_get_contents(https://savatriplef01.file.core.windows.net/uploadmytriplef/MyTripleF/Inkomend/Commissie Afrekening/Test Bestand_L=TestLeverancier.pdf?st=2020-09-22T08%3A45%3A26Z&se=2088-07-16T08%3A45%3A00Z&sp=rl&sv=2018-03-28&sr=s&sig=ANWMpYimZlvEM4qDVuDpljy%2B4KNHT%2BC47qtvrsDlXno%3D): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /home/vdouser/domains/mytriplef.nl/public_html/test.php on line 114
The file is name is downloaded and saved in FTP folder but the file size is 0kb and damaged.
Here is the code I am using:
file_put_contents("./azure_storage/".$folderName."/".$fileName."", file_get_contents($fileUrlWithSAS));
When I echo fileUrlWithSAS
it outputs following URL: https://savatriplef01.file.core.windows.net/uploadmytriplef/MyTripleF/Inkomend/Commissie Afrekening/Test Bestand_L=TestLeverancier.pdf?st=2020-09-22T08%3A45%3A26Z&se=2088-07-16T08%3A45%3A00Z&sp=rl&sv=2018-03-28&sr=s&sig=ANWMpYimZlvEM4qDVuDpljy%2B4KNHT%2BC47qtvrsDlXno%3D
When you visit it it downloads the PDF but the stored file is damaged.
Does anyone know why the file is not downloaded good on our server?
Thanks.