But the “webkitURL” does not exist on type window… So is there a method to create an URL for download a blob ?
Or maybe another method to achieve this ?
Thank you for your fast answer
But I checked this plugin before and the download method use an URL but I dont have it.
I just have the blob (or whatever you want) “result” and no URL to download it.
This URL is the web server URL, and we send an HTTP GET request to that url in order to get a docx/pdf file.
That request is returning a string, and I want to obtain the docx file from that. So I thought I needed to download the file from a certain URL, but i’m not sure about it.
How can I get the file from the string (without using the url of the webservice) ?
To me it sounds like you’re wanting to add an extra, unnecessary, step.
Exactly, so use FileTransfer.download on the URL for your web server? It saves the file on the device, and you can then e.g. open the file with other apps and what not.
Hum, I was trying to use FileTransfer.download but I have to add a specific header to my request.
So can I add that header with the FileTransfer Plugin ?
Really thank you for your help, but I will need a little more help I guess.
I have a prolem with the “target” property. I want that the user download it into the “Download” repositery. I tryed to use “file.dataDirectory” but dataDictory seems to not exist on type File. I also tryed to use the direct link like “file:///android_asset/storage/emulated/0/Download/” but didn’t work too…
Hav you a solution to dowload directly inside the Download folder ?
.download returns a Promise, you don’t seem to be handling any errors or anything. Also, I believe you need to add your own slash after using dataDirectory: dataDirectory + "/file.txt"
If the promise is resolved it should be all good, there are several other methods in the File plugin which you can use to e.g. see files in a specific directory
@mich356c@rushabh28@AhrenFullStop@fhochmayr
Ia m into the same issue, couldn’t able to open blob url in web, from mobile application.
Any solution or update would definitely be helpful.