[File Plugin] How to access Download folder (Internal storage/Download/) using FilePlugin
file-plugin
Forge component by OutSystems R&D
Application Type
Mobile

Hi all, 

I am able to save the file into the internal storage, and opened the file using OpenDocument from FileViewerPlugin. After I saved the opened file into the Download folder, how can I access it again through GetFileUri? I tried to find a way to access the root folder to access the Download folder under (Internal storage/Download) storage but they don't work. Appreciate it if anyone can guide me through it. Thanks.
Attached is the client action to access the storage, need advice on the Path to access "Internal storage/Download":

Regards,

Kenny

Hi all, I've solved my issue. Can someone close this thread? Thanks. 

how do you save multiple files from a action into a specific folder in pc?

Hi Prolacto, if you're referring to the traditional or reactive web, I would recommend you to check on the FileSystem extension. 

There are some actions that you can use or play around with for the specific folder. For the multiple files, what you can explore is to use the File_WriteBinary to write the binary to the folder you want. Here's some rough idea, not sure if it works.
1. Check if directory exists, if exist, use this directory. Else create the directory
2. ForEach File > File_WriteBinary(your desired directory)

Hope this helps. Thanks.

Regards,

Kenny

its for mobile and my action looks like this: 

I have 12 of those in the same action when i download it goes to the downloads in the mobile but i want them in the server and not in the folder of downloads

Action.PNG

Hi Prolacto, 

What do you mean by having them on the server? Do you mean to upload them to the database?

Regards,

Kenny

Sorry i said it wrong,

when i make the download i want the files to go to here:

but by mobile

final2.PNG

@Yung Shin  for example when i test the app in my pc it makes the downloads but when i do in my tablet it doesn t even show them downloading

example.PNG

Hi Prolacto,

Have you tried with the File Plugin?

FilePlugin: https://www.outsystems.com/forge/component-overview/1633/file-plugin


To download multiple files in a single action, I'm not too sure if you can loop the SaveFile action to store the file in the specific folder (External).
If this doesn't work,

Maybe you might want to try MobileZIP, which is another workaround for it.
MobileZIP: https://www.outsystems.com/forge/component-overview/4287/mobilezip
Note: For MobileZIP, you might want to update the dependencies' version.

Attached is my reply to one of the developers.

And for the implementation:
If you wanted to store multiple files in one single action, you might want to zip, download and unzip them in your mobile's folder. Before that, what I did is to put them in a ZIP folder first, download them into a folder as a ZIP file, then unzip the file there.

If you were to use the application online, can play around with the ZIP extension.


This is for you to append all your files into a single ZIP file. 

If you were to use the application offline, you may check out ZIP action in MobileZIP. What I do is that I save(SaveFile) all the files in the internal storage (encrypted folder within the application), and I zip them within the application, then I used UNZIP action to unzip them into external folders.

 You can ignore the GetFileUri as you can set your path hardcoded like the image above to store the files outside of the application. After that, you can delete the ZipFile created or whatever the file you don't need within the application through FileSystem's client action.


The reason for me to do so is due to the security of Android 10 and above.

Let me know if it doesn't work. Thanks.

Regards,

Kenny


Hi Yung Shin's,


Should the path be something like this ??


Regards,


Michael

cycle.PNG

Hi Prolacto,

I think your path will be created inside the application itself instead of outside the desired folder. I could be wrong here. 

You can try that and check if the file is accessible outside the application. If not, then it is being created within the app itself and you might need to read from the app. Currently, the only way for me to get the files outside of the application is to unzip the file to an external folder.

Regards,

Kenny

Good moring,

the sample isn t working and i may be doing the wrong way:

Regards,

Michael 

So..PNG

I just checked and it gives me an error called cordova is not defined

Notworking.PNG

Hi Prolacto,

Sorry for the late reply. Did you reinstall the application on your device yet?
Note that Cordova is not available in the browser, you can only test it once you had reinstall the application through the newly generated .apk.

Edit: If there's error in your app generation, do change the dependencies in the forge to fit your purpose.

Can refer to my previous reply on the .xml files.

Regards,

Kenny

hi,

so it works when i save them in mobile device

but when i try to save by LAN  it gives me this:

Cannot read properties of null (reading 'getDirectory') 

the path for the local server its this one: "smb://192.168.1.11/Shares/Fabrica Prolacto/Serviços Técnicos/48. Registos/pasta/"

does it work if i try by LAN?

Hi Prolacto,

I am afraid that I could not help you further with storing your file to a local server through LAN. Perhaps you can create a new thread on how to send the file from a local device to a local server. 

Regards,

Kenny

Hi Yung Shin,


Anyways thank you for your time and assistance helped me a lot 

Regards,


Michael

Hi Michael,

Not sure if SFTP will help in your case or not but you can always explore those. Cheers.

Edit: I used SFTP to move the file, perhaps you can check the options available.

Regards,

Kenny

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.