Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Issue with copying Large files to temp directory #9

Closed
ThinkDigitalSoftware opened this issue Sep 30, 2018 · 3 comments
Closed

Comments

@ThinkDigitalSoftware
Copy link

Large Files that are copied to temp directory may fill up storage since they're being duplicated. Also, it may not be preferable to copy the files to the temp directory at all times, for example in cases where:

  • the developer wants to edit a file in place,
  • the file is large and will take up too much space,
  • the file is too large to successfully copy,
  • the file will take too long to copy
  • The developer needs the original path location
  • the developer needs to work with other files contained in the same directory or files that the opened file may depend on.

Long story short, can the copying to temp directory be made an optional flag that defaults to true?

@sidlatau
Copy link
Owner

Reason behind copying to temp directory is that in this case there is no need to handle Android permissions - no permission is required when reading/writing file from app temp dir. Additionally in iOS this copying is performed automatically. Also it could be problematic to get path to file otherwise - file could be in Google Drive or iCloud - what kind of paths to return to Flutter/Dart side in these cases?
For these reasons in this plugin I have chosen to copy files to temp dir in all cases. I agree that it is not optimal but it handles most common cases. I am not planning to change this functionality but pull requests are welcome!

@ThinkDigitalSoftware
Copy link
Author

ThinkDigitalSoftware commented Oct 14, 2018 via email

@DamonChen117
Copy link

Don’t copy the document if you can avoid it.
From
https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants