How to Preview an uploaded document before submitting

we have a requirement where we need  preview the document (image, PDF,etc ) before submitting it.

I have tried with web previewer component and it is working fine for image preview but, when it comes to documents like PDF, Word it is showing some error message.

As web previewer is using the concept of i frames where data is kept in 3rd party sites and that URL from 3rd party is used to serve the purpose. This may not be acceptable in our project due to security concerns.

Is there any way to achieve our requirement??  

Hi saranya pappusetty,

Are you storing your binary (temporarily) so that you can preview using your web preview?

Actually i'm using Upload widget to upload file  and giving that upload widget file content to the web Preview

Hi saranya pappusetty,

Perhaps that (saving in database, even in a temporary way) would solve that. 

Because if you are using this Web Previewer, it says only can read content from database:

Or you could try also this one: