Azure / azure-storage-php

Microsoft Azure Storage Library for PHP
MIT License
217 stars 198 forks source link

How to upload file from URL in Azure Blob Storage from PHP? #304

Open Madhan-Tradezap opened 3 years ago

Madhan-Tradezap commented 3 years ago

Hi i want to copy image from URL to Azure storage using php

i am using PHP V8 and i already use file_put_contents to store image from url. How can we do it in Azure Blob Service.

In Regular PHP function

$image_url = "https://lh3.googleusercontent.com/ogw/ADea4I6YscwyB6zY_kLrgUwbZsPx32Fz8bq38jK1AzBo=s32-c-mo"; $pt_source = file_get_contents_curl($image_url); $file_name = "test.png"; $pt_img_to = $fixedDir . $file_name; file_put_contents($pt_img_to, $pt_source);