[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 7 Nov by OutSystems Experts
1 vote
Published on 7 Nov 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