Unable to drag and drop image in CEP extension

function openDocument(){
var fileRef = new File(“~/Downloads/myFile.jpg”);
var docRef = app.open(fileRef);
}

this is the extension script to drop an image from CEP with specified path,
but i need to achieve the drop functionality with url.
eg:(https://www.google.com/imgres?q=google%20images&imgurl=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F2%2F2f%2FGoogle_2015_logo.svg%2F800px-Google_2015_logo.svg.png&imgrefurl=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FGoogle_logo&docid=YYcJ4Dx_qJL9iM&tbnid=hcKs2PpO8qkg_M&vet=12ahUKEwiU_dun_ZOGAxU4mVYBHaq2DN8QM3oECBgQAA..i&w=800&h=271&hcb=2&ved=2ahUKEwiU_dun_ZOGAxU4mVYBHaq2DN8QM3oECBgQAA)

Can anyone please help me out.
Thanks.

Can you download the image from the url to temporary storage and then trigger the CEP based drag and drop?

@medium_jon Thanks for your reply
i think its not possibe to download with temporary location with specified path because of security reason.
and sometimes end user may not have permissons to download in specified path right?
then how can we proceed?
i wonder how bynderdam,dropbox and some DAM are done this…
is there any way to upload in the cloud and then using that url we drop in indesign.

Looks like I shouldn’t have said ‘temporary’
If you allow it in the manifest file, you have access to the plug-in’s local storage
storage.localFileSystem
Looks like I do it with these commands:
const g_uxp_o = require('uxp');
const g_localFileSystem_o = g_uxp_o.storage.localFileSystem;//used to read/write local files

and then have something like this in the manifest:

"localFileSystem": "fullAccess",

You’ll have to check the documentation for where in the manifest that goes.

@medium_jon it looks like plugin script
how to implement this in extension.like bynderdam and dropbox etc…

no idea on a CEP plug-in. What I shared is for a UXP plug-in.

Thanks @medium_jon .