2017-09-25 54 views
0

我試圖發佈一個用Ionic Cordova編寫的應用程序,但是我面臨着應用程序功能之一的問題。特別是,存在這樣的情況,你下載的在Android版本的作品完美文件的按鈕,但在iOS中我得到這個錯誤:無法創建保存下載文件的路徑 - Ionic iOS

FileTransferError { body = "Could not create path to save downloaded file: The file \U201c\U201d couldn\U2019t be saved."; code = 1; "http_status" = 200; source = " https://player.vimeo.com/external/221750072.sd.mp4?s=4dd5a5319a2484a715c54f58ef5b0e53&profile_id=165&download=1 "; target = "null.CHURCHOF%20SAINT%20JOHN.mp4"; } File Transfer Error: Could not create path to save downloaded file: The file 「」 couldn’t be saved.

+1

什麼是路? 「文件」「無法保存。」似乎路徑是錯誤的(沒有文件名稱集)? – Larme

回答

1

你是如何做的目標路徑?看來你使用的一些屬性是null,所以你應該修改它以獲得一個有效的目標路徑。例如,我爲此目的而使用像一個結構:

var destPath = (cordova.file.externalDataDirectory || cordova.file.dataDirectory) 
       + "path_to_destination" 

然後將文件傳輸插件:

var ft = new FileTransfer(); 
ft.download(url, destPath, success, error, true); 
相關問題