[File Viewer Plugin] File Viewing of files stored in device native URL

[File Viewer Plugin] File Viewing of files stored in device native URL

  
Forge Component
(1)
Published on 2016-11-07 by OutSystems Experts
1 vote
Published on 2016-11-07 by OutSystems Experts

Hi,

We were able to store the pdf in the device native url of the phone but the file viewer plugin displays an error of cannot display the file kindly see image below

Hi Valerie,


Can you confirm the file has content? Can you open it externally?

If you're using FileTransferPlugin to get the file, make sure you only open it after the OnDownloadComplete event triggers, otherwise you won't be able to open an empty file.


Kind Regards,

João Grazina

Hi Sir,

We can confirm that the file is transferred to the device native url but we are not using the File Transfer Plugin we used a file transfer plugin from apache cordova 

{
    "plugin": {
        "url":"https://github.com/apache/cordova-plugin-file-transfer.git"
    }
}

can the file transfer plugin create folders as well?

Hi Valerie, 


No it cannot.

It may be the case that you are not handling the events from the apache/cordova-plugin-file-transfer correctly and are trying to access the file before transfer is complete. 

I suggest you use the FileTransferPlugin (which is using that same apache/cordova-plugin-file-transfer) and is correctly wrapped around those events.

Furthermore, we have it in our plans to publish a new plugin to manage the file storage using apache/cordova-plugin-file, which supports folder management as well.


Let me know if you can work your way using that plugin.


Kind Regards,

João Grazina

Hi Sir João Grazina,

Ok will wait for the new plugin with the cordova-plugin-file because it will be a big help to out project, in the meantime we need to make this work, I tried to use the File Transfer Plugin transferring from Server to Device Storage and I am getting this error, I probably missed another step, maybe you could show me a sample or step by step.

Hi Valerie,

Attached is one example with the two plugins combined.

Regards,

David Martins

I have a website, http://scripturecrossreferences.com

which I want to make into an APP

My website does not currently have much programming in it. It mostly just open WordPad files.

Can I do WordPad files in this OutSystems and if so will they be responsive? How do I do them?

scripturecrossreferences@gmail.com


David Martins wrote:

Hi Valerie,

Attached is one example with the two plugins combined.

Regards,

David Martins

hello David Martins,

I have done your all steps which is used by you in above attachment of your app, but still it doesn't work.

can you explain it step by step..

I want to open pdf file inside the app..


Thanks & Regards

Shivani Singhania


Shivani Singhania wrote:

David Martins wrote:

Hi Valerie,

Attached is one example with the two plugins combined.

Regards,

David Martins

hello David Martins,

I have done your all steps which is used by you in above attachment of your app, but still it doesn't work.

can you explain it step by step..

I want to open pdf file inside the app..


Thanks & Regards

Shivani Singhania


Hi Shivani,

Can you please explain the problem that you're having? or a screenshot?


Meanwhile I detect a problem that on this plugin you need the reference to the "File Plugin", if you create a reference to that Plugin that you can find in the forge, maybe you can fix the problem.


Kind regards,

David Martins


David Martins wrote:

Shivani Singhania wrote:

David Martins wrote:

Hi Valerie,

Attached is one example with the two plugins combined.

Regards,

David Martins

hello David Martins,

I have done your all steps which is used by you in above attachment of your app, but still it doesn't work.

can you explain it step by step..

I want to open pdf file inside the app..


Thanks & Regards

Shivani Singhania


Hi Shivani,

Can you please explain the problem that you're having? or a screenshot?


Meanwhile I detect a problem that on this plugin you need the reference to the "File Plugin", if you create a reference to that Plugin that you can find in the forge, maybe you can fix the problem.


Kind regards,

David Martins


Please check this link and help.

https://www.outsystems.com/forums/discussion/32698/how-to-open-pdf-file-inside-the-app/#Post112751