Flutter: Share fire directly (PDF) - flutter

It's possibile to share directly a Pdf file in flutter? I'm using Share_Plus plugin but it only support url or direct path.
My case:
Pdf uploaded on firebase
I retrive the URL
tried to use URI to file but I can't find the direct path to use with share_plus
The only solution is to save the file in the local storage of the phone and then retrieve di path and use with share_plus?
Thanks

You can use Firebase Storage. Files are url-referable from there.
Read all about it here: https://firebase.google.com/docs/storage

Related

Download offline map at runtime in Flutter using Mapbox?

We have a flutter application where we want to use map functionality in offline mode.
Mapbox provides functionality in the flutter to use offline maps but .db file which contains offline data needs to be saved in the project at build time.
How to achieve the same at runtime?
also open to suggestions to use any other map service providers that works in both online and offline mode.
If you want to store a file on the device please read the official Flutter documentation about Reading and Writing Files
Essentially you need to add path_provider package to your project in order to retrieve the standard cache folder for every device and then simply save you file in it.
This is a my application similar behaviour code
//Get an available temporary dir on device using path_provider package
final Directory tempDir = await getTemporaryDirectory();
//Create a path with file name
final String tempPath = tempDir.path + '/' + 'yourFileName.db';
//Write file on device disk
final File file = File(tempPath);
await writeAsBytesSync(fileContent); //If it is a string use writeAsStringAsync
print('File written on disk');
Then using the file path you can simply read it from disk using readAsByteAsync method.
Remember that in the sample we are using getTemporaryDirectory() and as the documentation tell us
Path to the temporary directory on the device that is not backed up and is suitable for storing caches of downloaded files.
Files in this directory may be cleared at any time.
I would recommend to check out this issue on the github page of the flutter-mapbox-gl repository:
https://github.com/tobrun/flutter-mapbox-gl/issues/88
See the comment of vinceKruger:
https://github.com/tobrun/flutter-mapbox-gl/issues/88#issuecomment-559380534
It is not an official way, but seems to work!

How to upload and retrieve pdf file in sqllite database

I want upload pdf file into sqlite and retrieve the pdf file into listview how can I do that please send me the code after I retrieve the pdf file in list view it as to open in pdf file how can I do that please help me out
Thank in advance
I personally suggest you to use the cloud firestore to your application which will be helpful to upload or access the contents of files.
you can save the files in the firebase storage and then use the links to access them and list into the listview

Parsing Contents of Dropbox File in JavaScript Web App

Is it possible using the Dropbox JS SDK to create a JavaScript web application that is able to parse the files in a user's Dropbox? In my use case, the user has some JSON files that I would like to parse and preview in the browser. Will the filesDownload(arg) method allow for this type of application, or is it only able to download the file to the user's machine?
The download methods, such as filesDownload and sharingGetSharedLinkFile return the file content directly as a Blob, as seen in the download example.
As long as you can use a Blob to do what you want, this should be possible.

Google Drive: Automatically convert files on upload?

Is it possible to get Google Drive to automatically convert uploaded documents to the native format?
I know it works with manual upload (i.e. Google Drive can auto-convert files you upload via the website), but I want to avoid having to upload every file by hand.
I'd prefer to use the API, or better yet, dump the files in my ~/Google Drive folder.
Using the API, you can pass the convert=true parameter to files.insert. The uploaded file will attempt to be converted to a native Google Docs format.
Sure, see this answer. Note you can upload a text file or a csv file and set its content type to google doc or google sheets respectively, and google will attempt to convert it. I have tested this for text -> doc and it works. You will need to set the const contentType at the start of the code to one of the supported google mimetypes.

Browse file and store file url for uploading it later

I have a form in which you enter some data and you are able to attach files. All I wanna do is have a Browse button so i can select the file and store that file url in some var, so later when i want to submit the form...y can read that var and upload the file using its url. Im using Scala Lift. I search for examples in the web but couldnt find anything helpful. I only want to select the file and store the file url. Can someone help me? Thanks!
You can't store path to file on client's drive. Even if you get path like this, you can't upload file that is not manually selected by client.
I suggest doing AJAX based client.