Thursday 30 June 2016

View files [doc,csv,pdf,xml] in browser, How to show files in browser mode or file preview in browser


Use this :


1. Google doc viewer

 
https://docs.google.com/viewerng/viewer?url= FileNameOrFilePath
 
Ex: 
<a href="https://docs.google.com/viewerng/viewer?url=FileNameOrFilePath" target="_blank">
    Click here
 </a> 


Reference for Google Doc viewer:

https://github.com/jawish/jquery.gdocviewer

Or

Open as a iframe to display on own website :
<iframe src="http://docs.google.com/viewer?embedded=true&url=https://s3.amazonaws.com/pie-staging/uploads/development/file_attachment/document/31/ticketToShirdiNitinRajpurohit.pdf">
  <p>Your browser does not support iframes.</p>
</iframe>


2. Open office
 
https://view.officeapps.live.com/op/view.aspx?src= FileNameOrFilePath
 
 
Reference for Open office
  -  office-web-viewer 
  -  Office Url to view document
 
 
 

3.Data pipes for CSV file in browser Mode 

   http://datapipes.okfnlabs.org/csv/html/?url= FileNameOrFilePath
 
 
 Reference for data pipeline 
https://github.com/okfn/datapipes 
http://okfnlabs.org/blog/2013/12/05/view-csv-with-data-pipes.html



No comments:

Post a Comment