akash-mitra / webtheory

Web-superiority platform for the web-artisans. (WIP Version)
0 stars 0 forks source link

Add a handler for the /admin/media/fetchUrl #2

Open akash-mitra opened 4 years ago

akash-mitra commented 4 years ago

When an image url is pasted, editor detects that and send the information back to /admin/media/fetchUrl route via POST method. Currently there is no handler for this route in the backend. The handler should receive the URL, download the file from the remote URL to the /storage/media directory and then send back the server URL of the downloaded file to the editor. Then Editor can display the image here. The response back to the editor should be in the below format.

return [ "success" => 1, # 0 for failure "file" => [ "url" => "server url of the image" ] ];