1

I have a static HTML site. It's for a little food shop. They need to upload their menus and other every month. SO they need to upload PDF documents somehow. I think uploading to google drive is better. No ? It's easy than creating a seperate admin view to upload files and all.

so anyone can tell me how can I upload PDF in google drive and embed the link in my code ? There are eight menus and they need to show as thumbnails. When users click on them, they will download.

Root SL
  • 69
  • 1
  • 6
  • 1
    You might want to check this: http://stackoverflow.com/questions/25707891/google-drive-php-api-simple-file-upload – Rav Dec 14 '16 at 03:47

3 Answers3

1

Just do...this and enjoy

INSERT_YOUR_ID_HERE = your pdf file id

1st solution below

<iframe src="https://drive.google.com/file/d/**INSERT_YOUR_ID_HERE**/preview" height="100%" width="100%" frameBorder="2" scrolling="auto" ></iframe>


2nd solution

<embed
  src="https://drive.google.com/file/d/**INSERT_YOUR_ID_HERE**/preview"   
    height="100%"
    width="100%"
></embed>

enter image description here

0
  1. You need to share the pdf file to "Public on the web"
  2. The go to file > embedded this pdf file. This will give you the html code. Copy and paate it in your html code

Refer http://www.mybloggerlab.com/2013/03/how-to-embed-pdf-and-other-documents-in-blogger-posts.html

Vikas Umrao
  • 2,800
  • 1
  • 15
  • 23
0

It is simple to upload a PDF in Google Drive and embed a direct download link into your code. I have inserted an excerpt from labnol.org

Google Drive doesn’t offer a simple option for creating these “direct download” link but you can easily create them by slightly modifying the generated URLs. Here’s the trick.

A file hosted on Google Drive has a shared link that looks like this

https://drive.google.com/file/d/FILE_ID/edit?usp=sharing

When you access this link, it will render the file in the browser but if you can rewrite this URL slightly, the link, when clicked, will download the corresponding file in the user’s browser instead of opening it in the browser. The modified URL would be:

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

All you have to do is make note of the FILE_ID in the original URL and use it in the modified URL. For example, here’s an image file hosted on Google Drive that will open in the browser and here’s the modified URL that forces the browser to download the file.

scorgn
  • 3,439
  • 2
  • 20
  • 23