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.

Can anyone please help me out.

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
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 .