Skip to content Skip to sidebar Skip to footer

How To Send Pdf Converted From Base64 Through Intnet?

I've got the pdf file in base64, I decoded it, send through the Intent but unfortunately external apps can't read it (Evernote e.g. says that it can't open empty file). Another str

Solution 1:

Bug #1: You open a file, then attempt to hand it to another app before completing your work with the file (flush(), the missing getFD().sync(), and close().

Bug #2: You are doing disk I/O on the main application thread.

Bug #3: You are attempting to read the entire decoded PDF into heap space, which will fail for many PDF files, as they will be too large.

Bug #4: newFile does not point to the file that you are attempting to create, but rather some file with application/pdf in the path. As a result, the other app has no way to access your PDF, even if it were completely written to disk.

Bug #5: You do not have FLAG_GRANT_READ_URI_PERMISSION on the Intent, and so the third-party app may not have read access to your content (see the third bullet in the docs).

Post a Comment for "How To Send Pdf Converted From Base64 Through Intnet?"