How to Save File To Network Folder From Mobile App on WiFi

Hi!  My first posting...  New to this platform.  May be a bit lost.  I am looking for a plugin to save a picture I have taken on my phone directly to a shared folder on my local network.  The phone is connected to the network via WiFi and I can access the folder without any problems form other computers\devices.

What plugin can I use to save the binary file to the network shared folder?

Thanks in advance for your help!

Any ideas?

Hi Med, this is how I would do it, but there is probably another way too.


https://www.outsystems.com/forge/component/32/sftp/

https://www.outsystems.com/forge/component/59/extension-ftpwebrequest/


Download the FTP or SFTP component from forge (links above)  and reference it in your app.  Then create a server action that will ftp files to your local server when wi-fi is available. If you cannot reference the ftp extension in a mobile action you will have to create a public action inside a web app on the same environment and then reference that public action in your mobile app.


On your mobile app take the picture with the camera plugin and then use the action above to FTP the file to your server. 


I have done it before using this method so I am pretty sure it will work.


Let me know if it works.

Thanks for the suggestion.  It looks like first I have to save the image to local storage and then move the file to its final destination.  This is the first app I try building using this platform so even remedial things like this are a challenge at this time.  I will let you know how it goes.

Thanks for the help!

I would recommend File Transfer plugin, this plugin and a sample app is available in the Forge.

Kind regards,

Matthias

Hi Vonnelize and Matthias!

Thank you for pointing me in the right direction.  As a newbie, it is often challenging to figure out even the most basic of things.  Perhaps reviewing the tutorials would facilitate the process, but what's the fun in that.

Rather than using the SFTP approach, I am trying to use the File Transfer Plugin.  It is more in line with the functionality I am looking for.  However, I run into a problem.  I cannot find any documentation on how to reference the Server on the network.  On Windows, we use "\\ServerName\EmpPics" or should it be "smb://ServerName/EmpPics"?

When I run the app I built on my Android Phone, it errors out saying "Upload failed with error code:0".  I ran the sample app on the same phone and it works.  The difference is that the sample is moving the file to\from a Rest service, not a network path.

If this only works with Rest services, then I will have to use the FTP option.  Any suggestions?

Hi @Med, 

Did your problem get resolved?
I am also having that same problem though.

Cheers,
JohnB

JohnB wrote:

Hi @Med, 

Did your problem get resolved?
I am also having that same problem though.

Cheers,
JohnB

Hi JohnB,

The outsystems community may block this response... I ended up building the application on Microsoft's Powerapps.  It was sooo much easier.  Best of luck figuring this out.

Med


Hi Med,

Hahaha... well, I also know PowerApps but this time, it can't be done because the app is an existing one where I am currently updating it.

The mobile device is connected to internal network which can also access internet but it can also access NAS BUT there is no discussion in the forum about samba.

Cheers,
JohnB

Med wrote:

JohnB wrote:

Hi @Med, 

Did your problem get resolved?
I am also having that same problem though.

Cheers,
JohnB

Hi JohnB,

The outsystems community may block this response... I ended up building the application on Microsoft's Powerapps.  It was sooo much easier.  Best of luck figuring this out.

Med




@Med: for now I'm going to leave your response, but since this is your very first post on this forum, I doubt whether you actually know it's "sooo much easier".

@JohnB: unless you write your own handling in JavaScript, all communication from your mobile device is routed via the server. So it isn't a Mobile problem, but a server one. You could check the FileSystem component if you go that route.

Kilian Hekhuis wrote:

@Med: for now I'm going to leave your response, but since this is your very first post on this forum, I doubt whether you actually know it's "sooo much easier".

@JohnB: unless you write your own handling in JavaScript, all communication from your mobile device is routed via the server. So it isn't a Mobile problem, but a server one. You could check the FileSystem component if you go that route.

I do agree that "how easy" something is, is relative.  All I can do is speak of my experience from almost 2 years ago.  I couldn't say how the two platforms compare these days.

Two years ago, I devoted a week to trying to build an app on this platform and was not able to do so due to the limitation\problem described in this post.  Being just as new PowerApps as I was with Outsystems, I spent two days building the app in PowerApps.

In my particular case, it was a easier to build my solution on PowerApps.

Kilian Hekhuis wrote:

@Med: for now I'm going to leave your response, but since this is your very first post on this forum, I doubt whether you actually know it's "sooo much easier".

@JohnB: unless you write your own handling in JavaScript, all communication from your mobile device is routed via the server. So it isn't a Mobile problem, but a server one. You could check the FileSystem component if you go that route.

Hi Kilian,

It is actually not a server one because the problem on my end is that the mobile is connected to a certain network which has a NAS and can also connect to internet. The problem now is that files are in that NAS and using those mobile plugins just won't work because normally, those are designed for local storage not for network drives. I had been checking out in cordova for samba library but there's none, hence, this one is very tricky in the side of OutSystems.

Cheers,
JohnB


Hi John,

So how do you acces the NAS from your mobile device, apart from OutSystems? Do you have a specific app installed that accesses them? Because as far as I know, neither Android nor iOS have out-of-the-box capabilities for accessing network drives (since the "drive" concept doesn't even exist on mobile).

Solution

Hi Kilian,

Yes, there is no out-of-the-box yet however, I found a way by utilizing FTP.
I've created a simple FTP which can only be accessed within the network then created an FTP plugin out of the Cordova plugin available.

Cheers,
JohnB

Solution

Hi John,

Great to hear you got it working! You may think of putting your component in the Forge :).

Kilian Hekhuis wrote:

Hi John,

Great to hear you got it working! You may think of putting your component in the Forge :).

Hi Kilian,

Yes, it was my plan. I just need to properly create the sample app so that others may know how to use it.


Great to hear John! Happy coding!