I'm making use of a GitHub (xkeshi / image-compressor) project that compresses images using JavaScript. It generates a download of the compressed file with the following link for example blob:http://localhost/945f825f-054a-4170-9d79-ac1dba593d23
Note that the URL starts with blob:
How to upload with PHP from the file to the server, since apparently the file is local?
Data:
GitHub project that originated question: link
What I've tried
<?php
//Arquivo que desejo fazer upload blob:http://localhost/945f825f-054a-4170-9d79-ac1dba593d23
$url = 'blob:http://localhost/945f825f-054a-4170-9d79-ac1dba593d23';
$img = '/p/a.jpg';
file_put_contents($img, file_get_contents($url));
?>
Error displaying
Warning: file_get_contents (blob: link ): failed to open stream: Invalid argument in C: \ xampp \ htdocs \ 1 \ a \ b \ docs \ p.php on line 5
Warning: file_put_contents (/p/a.jpg): failed to open stream: No such file or directory in C: \ xampp \ htdocs \ 1 \ a \ b \ docs \ p.php on line 5