Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Pedro Gonçalves
Staff
138
Views
1
Comments
[OutSystems Now] DeviceFeatures\SaveFile webblock: how to save file in a different directory?
Question
Forge
OutSystems Now (O11)
Forge asset by
Platform Maintenance
Hi,
When using
DeviceFeatures\SaveFile
webblock, if I include a directory path in the Filename input parameter (e.g.
"
outsystems-now-test/log.txt
"
), it won't work and I get an INVALID_MODIFICATION_ERR message, such as the one below:
Probably some error in trying to modify the device's filesystem (this is Android, by the way).
Any ideas on how to overcome this?
Will further digging into the
Apache Cordova API
be needed?
Thanks!
César Afonso
Staff
Hello Pedro.
The way that the SaveFile WebBlock is implemented won’t allow you to provide that kind of paths. It just expects the Filename. To achieve what you want you’ll have to change the SaveFile javascript to use more sophisticated logic. One example is using the
resolveLocalFileSystemURL
window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory, function(dir) { });
For more examples you’ll have to take a closer look at the
Cordova File Plugin – Where To Store Files
Thanks
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...