0

I have multiple apps that take photos and store them on external storage.

I want to upload the photos along with some metadata to a web application running on my companies server.

I am able to write data and file URI to a database using a ContentProvider.

I have written a SyncAdapter to upload the files via HTTP-POST, but I am stuck because in this SyncAdapter I cannot get permission to read the files.

My big question is: Can I use a FileProvider to overcome this issue? I am NOT storing the files in the ContentProvider using an intent.

I have tried to set permissions on URL, it failed.

I Desperation I tried to export the FileProvider, which was not allowed.

I want to be able to open an input-stream of the file in another app than the one storing the file without having to start the transfer using an Intent.

Ahmed Hegazy
  • 12,395
  • 5
  • 41
  • 64
  • Please post a code snippet of what you are trying to achieve/what is going wrong thanks. – Nathan Headley Jan 22 '19 at 13:53
  • a `FileProvider` may help, but maybe you can accomplish what you want without it. Can you please show how you are writing the photos and how you are trying to read them? are these photos accessible by other means like an external photos app? – nandsito Jan 22 '19 at 14:00
  • Maybe a dumb question, but on the server itself where the files are being stored and the app is running does the user of the app have permission to read and write from the folder/file? – edjm Jan 22 '19 at 14:04

0 Answers0