828
Views
5
Comments
How to download a file to my mobile app
Application Type
Mobile
Platform Version
11.14.0 (Build 32648)

The end goal is to be able to email an excel document as an attachment.  I've got the email part working but the attachment is the problem.  The excel document I would like to attach is that same one used to populate the entities in my apps database.  The thinking was that I could just reference that file in Resources, attach it an be on my way.  Since I have no idea how to reference the file (ie get it's path) all my attempts resulted in no such file errors.  It then occured to me that may the file isn't included in the app binary and that i need to download it to the app and save it local storage.  I've tried several of the assets on the forge, each has a requirement to provide a path or url to the file.  I have not idea how to get that information.  None of the plugins etc i've tried provide those details in their documentation.

The easiest solution would be to be able to have the excell document included in the app so I wouldn't need to download it.  If there's a way to do that, I'd love to hear about it.  Otherwise any tips as to how to achieve my goal of attaching an excel doc to an email would be much appreciated.

Thanks

UserImage.jpg
Tom Meehan

Thanks for your response.  The problems still remain however.  


With file-download-plugin, there are two input params that are required. 

"Binary" which is supposed to be of BinaryData type.  The problem is that I am downloading the binary in question so it's not available at the time I initiate the download.  Not sure how I can input the result of the operation that I am initiating.

"FileName" Entering the filename is easy however it seems that there would need to be some indication, somewhere, as to where the file with the input name resides.  Many of the plugins etc that refer to files and directories (including this one) require that one know the names of the various directories on the server and, for that matter, in the app itself.  Admittedly I am new to Outsystems (I have been developing for IOS for 13 years) so I don't know how to refer to any paths or urls, anywhere in the environment.  So right out of the blocks I am dead in the water and I haven't found any documentation that shines a light on any of this.  Sadly my online inquiries for help with this have all gone unanswered 

With "file-plugin" I don't see any functionality that deals with downloading files.  It did look promising for a possible solution for determining filesystem details such as discussed above (paths and urls etc).  However even the list directory function requires that one must know the parent path or some other point of reference.  Game over.


Are you able to fill in any of the many holes in my understanding?

2021-09-21 09-26-31
Aadhavan Shanmugam

Piece of help - You can use File Downloader for Mobile component to download files from the mobile applications.

Demo : https://aadhavan.outsystemscloud.com/PreviewInDevices/?IsMobilePreview=True&DeviceName=Smartphone&URL=/SampleAppforFileDownloader/Screen1

Hope this may help to your idea (added based on subject)

UserImage.jpg
Tom Meehan

Thanks for. your response.  This has promise however I don't know what to enter for the URL input param.  My app uses an excel document to bootstrap entities into my database.  All that works fine.  I have a feature where the user can have the excel document emailed to themself or anyone else for that matter.  I have got the email composing done - which works but when I attempt to add the excel document as an attachment, the app crashes.  The attachment needs a file path - which is the problem.  I don't know how to reference the file as a url or a path.  This is basic stuff that I don't know.  Just because I used an excel document to create my database, doesn't necessarily mean the doc itself exists somewhere on the server or in the app binary in a location it can be referenced.  Any ideas as to how this is done.  I just need to ascertain the location of the document and a way to reference it in the attachment field of the email.  This is what started the whole download rabbit trail.  I figured that the excel doc exists on the server only and that I would have to download it and save it to local storage on the device.  Am I way off base on all of this?  Any light you can shine on this will be most appreciated.  Thanks.

UserImage.jpg
Rateendra Talekar

Can u please share Oml fiel

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