Closed matthew-carroll closed 6 years ago
Could you give me your url that you are trying to download?
Sure, it's an RSS feed: https://rss.simplecast.com/podcasts/1684/rss
I tried replacing a link in my example app by your link and it works well. I can also open the downloaded file (by giving it a name such as rss.txt
that let iOS detect the file type).
By the way, I run on iPhone simulator and iOS 12.
Hm. I'm trying to run it from a flutter driver test. Any idea if that changes anything?
Sorry, I have no idea. btw, your file is quite tiny, why don't you download it by http library directly?
I will be downloading larger files as well and I want to handle all file downloads the same way
@hnvn I tried creating a new test app just to verify download behavior and I still can't seem to get files downloading. I tried downloading one of the files from the flutter_downloader example app, it still errors out.
However, when I run the example app, it works.
Are there any other settings that need to be configured for an iOS app other than background execution, sqlite, and transport security settings?
Looks like this thread lost my last message...
I ran the flutter_downloader example app and it seems to work.
Then I created a new test project and tried to replicate one of the file downloads from the flutter_downloader example app, but it didn't work in my test app.
Are there any additional setup steps other than enabling background execution, sqlite, and transport security?
Another update: I took the official example project, simplified the code as much as possible, then ran it in a Flutter Driver test, and the downloading works.
I copied that exact code into a new project, and the downloading fails just like before.
So I'm getting the impression that the issue is somewhere in the iOS project itself. Are there any other modifications that I might have to make to the iOS project, or even the Flutter project, to get downloads working?
Curious, Is there's any other error message?
It looks like it's working now. I'm not sure what, if anything, has changed. I'll go ahead and close this issue and I'll reopen it if the issue returns. Thanks.
PS - I may send some PRs your way with some suggestions to make this lib more generally applicable (for example, making the persistence mechanism pluggable so that developers don't have to use sqlite just to download files).
OK, it's great to hear that
I am having the exact same problem. I also was able to get my download link to work in the example project, but copying the same code to my project results in the error "Unable to copy temp file. Error: The file “CFNetworkDownload_[id].tmp” doesn’t exist". I've followed the directions for adding the iOS dependencies, any other ideas on how to get it to work?
I compared Info.plist files and found my project was missing
<key>FDMaximumConcurrentTasks</key>
<integer>5</integer>
<key>FDAllFilesDownloadedMessage</key>
<string>All files have been downloaded</string>
Not sure if that's exactly what fixed it but after adding this to my project, it worked.
I had similar error:
Unable to copy temp file. Error: The file “CFNetworkDownload_KEWh6v.tmp” doesn’t exist.
The issue was missing destination directory. Something similar to below code from the sample project:
final savedDir = Directory(_localPath);
bool hasExisted = await savedDir.exists();
if (!hasExisted) {
savedDir.create();
}
I'm attempting to download a file on iOS. The output shows a series of lines that read "Unknown transfer size" and eventually outputs the following:
Unable to copy temp file. Error: The file “CFNetworkDownload_ZVHUze.tmp” doesn’t exist.