Open a downloaded file with a third party application - react-native

I have an application that allows users to download files from the server, these files can be pretty much anything.
I am at the point where a user is able to download a file to their phone but I can not figure out how to allow the user to open the files from the app, for example say a user has download a word file (.docx), when they select the file in my application I want the file to either open in the default .docx viewer or present the user with applications that can open the file. (Similar to how WhatsApp handles it)
I have tried using Linking.openURL('file:///pathtofile/filename.docx') but I get an error saying Could not open URL file:///pathtofile/filename.docx, exposed beyond app through Intent.getData()
I'm currently using Expo and would much prefer not to have to detach my app.
Update:
I ended up detaching from Expo and built native modules to handle this.

Related

How to read files from anywhere with vue.js

I am trying to read files from my music directory on my PC.
I have tried doing it with the node.js file system module, but it is not working. How do I get it to work?😢
Just a late follow-up. It is possible to read and write files using HTML5 with the FileReader and saveAs(). The browser will open a file dialogue and let the user choose the file, so the user is aware of the file access. It is not possible to read or write to a file without the user's attention.
https://developer.mozilla.org/en-US/docs/Web/API/FileReader
As said by #flame in a comment, it's just impossible, because the browser never have access to the visitor's disk (do you imagine the security issue if it was the case ?).
Vue.js is a Front-end framework, so the application it produces only have access to what the browser has access to.

Is it possible to create a shortcut to a file that is in Google Drive?

I have asked this question so that they can respond that it is possible to create a shortcut for a file that is in the cloud, this access will be created in the device memory, what is the purpose of this: My application has integrated a function to upload a file to the cloud and then run it from a system application like player, gallery, among others, but without having to download anything, but from an application that is installed Installed on the device (nothing external). Thank you very much.
You may want to check Create a shortcut to a file. As mentioned,
To create a shortcut instead of a file stored in Drive, use the files.create method of the API and make sure you set the MIME type application/vnd.google-apps.drive-sdk. Do not upload any content when creating the file.
However, for Google Drive Android API, you may want to check Creating Files for more information.

Filelauncher save files

Let's say i have a list of files. When I click on one it will get downloaded and saved into the app's isostore. Then it's opened in the default viewer/editor on the windows phone like this:
Windows.System.Launcher.LaunchFileAsync(file);
But when I make some changes to the file and want to save it, it can't, because it's a read-only copy of the file. Is there some way to get write-access to the file or else some public/shared (iso)store that every app has access to? The goal is to download the file, edit it and upload it back to the server.
Per the Windows Phone documentation, the Windows.System.Launcher.LaunchFileAsync API is not implemented for the Windows Phone platform:
Windows Phone 8: This API is not implemented and will throw an
exception if called.
In regards to saving the file so that it can be accessed by other applications, this is not possible, unless the file you are dealing with is a photo, in which case you could use the Media Library API.

Monitor changes made by a desktop app to a file created by my Windows Store app

I'm making a Windows Store app that gets files from a server and store it locally for quick access. I also want to make it sync the file with Dropbox and push changes to Dropbox if the user make any. I looked into CachedFileUpdater and it seems to work if I use another Windows Store app to edit the file. However I ran into a great trouble trying to monitor changes made by a desktop app. This matters a lot because many files are office documents and Office 2013 is available to Windows RT and I would also like the app to be available to Windows 8.
First I tried to use CachedFileUpdater on all files but when I open the file using a desktop app, it will be opened in read-only mode and I can't save it in desktop mode. If I dont use it if the user chooses to open it with desktop app, the change will be saved but later my app won't be able to access that file somehow. I guess it is because the owner changes to the desktop app. Now not only I seem to have no way to monitor the file changes, but also can't I access those changes once it is modified by a desktop app.\
Is there some trick that may help? Thank you very much!

Transfer/Copy files from one iPad app to another iPad app for Editing

I am wondering if there is a way in objective c to have my iPad app copy a file in it's documents folder to another app's documents folder and have that app open the file for editing and finally copy the file back to my documents folder. Or better yet, can I have another app open a file from my documents folder, edit the file, and save it back to my documents folder?
So far I know I can have another app open a file in my documents folder but the app that I'm handing the document off to seems to be making a local copy and editing the copy. I also know that each app's document folder is a shared folder that users can drag and drop stuff from itunes but I'm not sure if the same can be done in code.
I am pretty sure what you are trying to do is impossible. iOS applications are "sandboxed" which means that each app has its own documents directory. No application has access to the file system outside its own "sandbox" i.e. outside its own local documents directory.
For more on the iOS application sandbox, Read here.
Though a sandbox exists, I found a way to work around it (it's a trick being used by other File Manager apps like GoAruna). I would first register my app as an app that can open the type of files that I plan to work with. Then I use the Open In functionality to have my users open up my apps local documents in the second app, an app like iAnnotate. Then, because my app is registered as an app that can open the current file type, I can instruct my users to use Open In from iAnnotate to move the modified document back to my app. Sorry but I could not accept "no" as an answer. If anyone is interested in this approach, go here
If your iPad is jail broken, try this:
On the app iFile, type in the document name in the search box located at the top. Once you find the document, click on it and options would be showed to you. From here you can choose the app you want to open the file with.
Hope this helps.