ios drop file wrong file name

I use the following simple JS code to drag file from the browser to the desktop.

Works perfect on MacOS.


onDragStart(event, ucpView) {

let file = new BrowserFile([this.file.fileContent], this.file.displayName, {

type: 'application/ucp-scenario'

});

const fileURL = URL.createObjectURL(file);

event.dataTransfer.setData("DownloadURL", `application/octet-stream:${file.name}:${fileURL}`);

event.dataTransfer.setData("text/uri-list", fileURL);


}


but on iOS it keeps nameing the file

Text1.txt

Text2.txt

...

and ignores the DownloadURL


whats the best way to get it workng on both OS?


Posted on Apr 4, 2025 6:33 AM

Reply

Similar questions

2 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

ios drop file wrong file name

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.