[File Plugin] File Plugin on latest Platform Server Development mode Version 10.0.705.0

[File Plugin] File Plugin on latest Platform Server Development mode Version 10.0.705.0

  
Forge Component
(1)
Published on 5 Mar by Experts
1 vote
Published on 5 Mar by Experts

Have someone tried this on this new platform? It seems like the SaveFile function no longer works for Android if you build the apk. I remember it should save the file in the path specified, but somehow it is no longer happening.

Rom wrote:

Have someone tried this on this new platform? It seems like the SaveFile function no longer works for Android if you build the apk. I remember it should save the file in the path specified, but somehow it is no longer happening.

yeh, quite bizarre, it was working two days ago, but today it is not. Something else I've noticed too; in my mobile app, I first check whether the file has already been downloaded (saved) by calling FilePlugin.GetFileUri client action. For a new file, this of course returns ErrorCode 1 (Not Found) and then I proceed with FilePlugin.SaveFile which does not report any error. On contrary, the output parameter Uri contains expected path (file:///data/user/0/com.outsystems....../files/some/path/filename.dat), but there is no file there. When I then try the same file again, FilePlugin.GetFileUri returns expected path, but as mentioned, there is nothing there...

I'm using Service Studio 10.0.707.0, File plugin v1.02 and generating mobile app for Android...


Hi D1,

Just tried setting the StorageTypeId to External and it now works. Not sure yet what will happen if device does not have this option. Before, I just leave this blank which is set to Internal by default.

Regards

Hi Rom,

thanks for the reply, unfortunately that didn't do the trick. However, now I am receiving "Cannot read property 'dataDirectory' of undefined". When I change StorageTypeId to External, the message is slightly different - 'dataExternalDirectory'. In a different thread, I've noticed you have had the same problem, how did you fix it?


Hi D1,

That's all I did. Just changed to External and it worked. It still works even if device has no external storage. 

You may also want to check if the app has permission to store files into the device storage. Although mine has no permission but still works.

Regards

Solution

Thanks Rom,

my problem was somewhat multi-fold, but ultimately Jonathan came to rescue with updated version of the FilePlugin. Check this conversation.

but still, your hint regarding external vs internal storage was also helpful as I was referencing internal (seeing that Android itself refers to SD card as external).

All good now, thanks for the assistance :)

Dean

Solution

Hi Dean,

Thanks Dean for the link. I think the suggestion given by Jonathan is the more logical solution. It also works on my end.

Hi guys,

I've fixed the component (version 1.0.3), adding a tag to that specific version.

Thank you for your solution!

Kind Regards,

João Grazina

Rom wrote:

Hi D1,

Just tried setting the StorageTypeId to External and it now works. Not sure yet what will happen if device does not have this option. Before, I just leave this blank which is set to Internal by default.

Regards


Hi Rom, I tried to set the StorageTypeId to External and It really works. Thanks a lot!!!

Nhorwin