I'm using angularJS and PHP to upload file. From angularJS part I'm sending a blob url like this:
{
$ngfBlobUrl: "blob:http://test.dev/91458ff7-fc18-4bbc-8dae-f06941e0a1c9"
selectedCategory: "1",
name: "some_file_name.pdf"
}
and on PHP side I'm trying to get file from blob url and save it on local storage.
Here is my code on server side:
$blob = $file['$ngfBlobUrl'];
$f_name = $file['name'];
$filename = uniqid() . '_' .$f_name; // generate unique file name
if(@file_put_contents($destination.'/'.$filename, @file_get_contents($blob)))
{
// do something!
}
file_get_contents() function is returning failed to open stream: Invalid argument. When I put in browser that URL the pdf file is loading correctly.
Does anyone have an idea how to fix this or to use another way to read file from specified blob url.
Thanks in advance!
$filecome from?