Hi
I am working on mobile app and want to open a word document(which I have saved in resource folder) on click of a link.
BUT it is not working.
Hello Shubham,
So basically we decided to do a Skype call to address the problem and it worked afterwards.
Here's a summary:
For iOS: $parameters.FilePath = "tmp/"; (Temp Directory)
For Android: $parameters.FilePath = "Documents"; (Documents Directory)
Kind regards,
Rui Barradas
Rui Barradas wrote:
Thanks Rui
Why are you filling both filePath and urlFile parameters?
The filePath parameter is to use when you want to open a file which is saved in the device file system. The urlFile is the parameter to use when you want to open a file from a URL.
In this case, you want to open a file from your device, so you just need to fill the filePath parameter only.
Still not working.
Hello again Shubham,
Also, your mimeType parameter is incorrect. Try to use application/pdf for PDF files and application/octet-stream for other types of files.
Hi Rui
I have made the changes. It is still not working.
Anyway can you share an OML?It would be helpful.
Thanks.
Hi Shubham,
I created a small demo app covering your requirement, hope this will help you in some way.
PFA - includes .oml solution file
check this: Demo App
Hope this helps you!
Regards,
Benjith Sam
Benjith Sam wrote:
Hi Benjith
The above given solution works if I am putting a url of file on another server. We want to show a doc which is in the resource folder.And I am not sure whether I am giving the correct url or not.
Can you please give the proper sequence of url ?
Thanks and Regards
Shubham Agarwal
Shubham Agarwal wrote:
In the attached .oml solution, if you observe the defined IFrame is referring the document file from Resource Directory of the same environment not from the external env resource.
Syntax
https://docs.google.com/viewer?embedded=true&url=ResourceURL
Resource Url: Environment_Path + Resource_File_Runtiem_Path
SyntaxEditor Code Snippet
https://docs.google.com/viewer?embedded=true&url=https://sbsam.outsystemscloud.com/TestMe/Sample.docx
For more reference: https://stackoverflow.com/questions/9193144/how-to-open-specific-page-on-googles-docs-viewer
Hi Benjith,
It is working with a lag. There are two problems:
1.) When I am trying to open it first time in incognito window, it is not opening. But when I reload it again it is opening. Are you also facing this issue? If yes , please suggest some solution.
2.) Is there any limit on the size of document we can open using iframe and it is different for different formats like doc or docx because some of my files are opening and some are not?
You can use like below.Pls see attached too
Hello Rui,
For some reason the pictures you have uploaded in your solution dont seem to display, Can you upload them again if you have time?
I have raised a similar issue in https://www.outsystems.com/forums/discussion/59939/file-viewer-plugin-version-1-0-3-os11-doesnt-work-with-android/
But after setting the Path to "Documents" for Android, the file still wont open. Wonder if I have done anything wrong.
Hello Christopher,
If you want, message me directly and I will try to send you the pictures.
Anyways, I will look into your issue as soon as I can.