filename, directory and baseDirectory with iOS Image Picker #150
Replies: 1 comment 1 reply
-
Hi, thanks for reaching out. I am not familiar with the asset picker on iOS, but from the directory path you list it seems like those assets are stored in a separate (temporary) location. The
946D9300-FC20-42FD-B600-3A0E92376AC3 is the dynamic app identifier, which will change every time the app is started. This is the reason why we can't just use a full path, as that path may no longer exist by the time the downloader starts its background task. As you can see, neither of these directories resolve to something that follows the dynamic app identifier with /tmp, so effectively that directory is not reachable by the downloader. The solution is to copy any files you want to upload from the directory where you find it to one of the directories supported by the downloader, as referenced by the The full path that the downloader file location resolves to is the directory that Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
First of all, thanks for the great plugin!
I fail to find the right combination of what to set for filename, directory and baseDirectory if I want to upload a photo from the library. I get from the asset picker back (on iOS) something like this:
/Users/martin/Library/Developer/CoreSimulator/Devices/40394A4F-1D64-4704-9F0B-A62E32514FA5/data/Containers/Data/Application/946D9300-FC20-42FD-B600-3A0E92376AC3/tmp/flutter-images/27f440039fee318ad8d0262a052075a4_exif.jpg
I set so far filename = 27f440039fee318ad8d0262a052075a4_exif.jpg
and getting:
Unhandled Exception: Invalid argument(s): Directory must be relative to the baseDirectory specified in the baseDirectory argument
directory: directory,
baseDirectory: BaseDirectory.applicationSupport,
directory is the full path minus the filename.
Any idea? Thx :)
Beta Was this translation helpful? Give feedback.
All reactions