Friday, February 1, 2013

How to view or Download Google Drive files on your site

How to view or Download Google Drive files on your site

Many of you wanted to show images, videos etc... on your site which is uploaded on your Google Drive.

The link of the file will not be the same at all times due to security reasons. 
So Google provides another method to show or download a file.

For this method you need to get the file id. For that open your file. 
Look at the url box of your browser.


As shown in the image you should select the word before /edit and after d/.
This selected text will be the file id. Copy the file id.


To View

https://drive.google.com/uc?export=view&id=fileid
Replace the red text with the file id. You can use this url to show an image or any other file.
An Example:
<img src="https://drive.google.com/uc?export=view&id=0B2VjYaTkCpiQT0tRSWQzVHMxR1U">

To Download

https://drive.google.com/uc?export=download&id=fileid

Replace the red text with the file id. You can use this url to download a file.
An Example:
<a href="https://drive.google.com/uc?export=download&id=0B2VjYaTkCpiQT0tRSWQzVHMxR1U">Download this file</a>

No comments:

Post a Comment

Leave the comments