mardi 15 septembre 2020

PHP download image from url without direct image name

/sfc/servlet.shepherd/document/download/0694U000007w5QyQAI?operationContext=S1

this url content a file with name ine_file.jpg, when run in browser work and download the file direct, but when i try download with php and save the file in local no work

i try with:

file_put_contents(public_path() . "/" . $fileName, fopen($file["url"], 'r'));

and

    file_put_contents(public_path() . "/" . $fileName, file_get_contents($url));

any idea ? How to get a file from url and save the file using php o curl?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire