rolinger commented on issue #367:
URL:
https://github.com/apache/cordova-plugin-file-transfer/issues/367#issuecomment-1701453303
@breautek - well....good news. Changing the name allows for redownload of
file. And after downloading, navigating to folder with phones general file
manager allowed me to open the file with another app. However, the other app
did require permissions to access the file; it opens dialog "Go To Settings",
which then opens to "All Files Access" forcing the user to allow access for the
app they choose to view the file with. Tried it on several different app types
and it was the same for all of them.
The equally good news is that the other app asks for the permissions, so I
don't have to code in my app giving permissions. I don't want the user viewing
files in my app anyway...too many issues rendering different file formats in my
app - just easier to let native apps do it.
```
function priFileDL(fInfo){
startStatus(fInfo.cfID,"black","Starting download...") ;
var fileTransfer = new FileTransfer();
var folderPath=fInfo.dir+fInfo.cfSave ;
var onSuccess= function(e){
fileDone(fInfo,e) ;
if (ionic.Platform.isIOS()) {
fileMove(folderPath) ;
}
};
var onError=function(e) {
// this handle issue if user had downloaded file before
// and then manually deleted it from a file manager
// this appends the name, making it a unique download
if (e.exception.includes("EEXIST")) {
var n = fInfo.cfSave.split(".") ;
n[0] += "1" ;
fInfo.cfSave = n.join(".") ;
priFileDL(fInfo) ;
} else {
fileError(1,e,fInfo) ;
}
};
fileTransfer.onprogress = function(pe) {
fileProgress(pe,fInfo) ;
}
fileTransfer.download(fInfo.url,folderPath,onSuccess,onError);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]