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.
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
Rom wrote:
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, I tried to set the StorageTypeId to External and It really works. Thanks a lot!!!Nhorwin
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?
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.
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
Hi Team,
Can anyone mention that how to provide the path for android and ios .
Im getting error dataDirectory of undefined.
And please suggest me solution.
Thanks
Pasupathi.V
Hi Pasupathi,
Get the operating system of the device
Create a Variable name "Filepath"
and inside the javascript Filepath for android
i created a output parameter filepath inside javascript
$parameters.FilePath = cordova.file.externalCacheDirectory;(for android)
for ios
$parameters.FilePath = cordova.file.tempDirectory;(for ios)
Hope this will help you
Regards,
Koushik
Hi koushik,
Im having an error "Cannot read property 'externalCacheDiectory' of undefined
pasupathi vadivel wrote:
add plugin manager javascript on page level which you can find inside common plugin
I have added the plugin manager in the page level but still getting the same error.It return the error when process the js.
Pasupathi.v
can you send your oml file i will look into it
Please find the ButtonOnClick2 client action of the attached oml file.
you have to add the action on page ready just go through this oml file
I cant see your oml ,because im having platform server 10 ,Can you please provide any screen shot of calling that action and let me know the changes that you made.
download this forge componet https://www.outsystems.com/forge/component-overview/1634/file-sample it will help you
Hi Kosushik,
Thanks for your help, we can save the file now, Actually my complete requirement is viewing a binary file in mobile .
After save file action im just passing SaveFile.Uri to open document of file viewer plugin .But its not working.it returns not available error.
Thank you so much for your support koushik. I can save and view the files now by doing the same with outsystems11.
It's nice to hear that the issue is resolved.
Koushik Prathi wrote:
Hi, Sorry to dig up old thread but after following the insturctions you provided I'm still unable to advance past this error.
Any solution? I suspect it's the javascript that's causing the issue
EDIT: Nvm fixed it by regenerating APK