Google Drive Direct Links
The following links allow for direct access to items from within Google Drive (as of the posting of this anyhow).
- Share the file you want to pull from Google Drive
- Copy the share link, set the permissions to "Anyone with the link"
- Paste the share link somewhere (to get the ID)
- Use one of the URLs below and add the ID of the item
- Use the new URL to get direct access to the file!
Direct Access Link¶
https://drive.google.com/uc?export=download&id=FILEID
Example Usage¶
Your file in Google Drive: https://drive.google.com/file/d/1aVlxT16wL5bbPamincSEPp0RB1c4nrwk/view?usp=sharing
The File ID from the above link: 1aVlxT16wL5bbPamincSEPp0RB1c4nrwk
Final Direct Access Link: https://drive.google.com/uc?export=download&id=1aVlxT16wL5bbPamincSEPp0RB1c4nrwk
Images¶
For images, especially when using in web related tings like HTML, I found this URL to work best:
Direct Access Link: https://drive.google.com/uc?id=DRIVE_FILE_ID
For example: <img src="https://drive.google.com/uc?id=DRIVE_FILE_ID" alt="Google Drive Image" />
Other Google Drive Links¶
Google Docs Reader Mode¶
Add a /preview to the end of the URL to view it in reader mode's UI (replace the /edit part).
Before: https://docs.google.com/document/d/1nJcfN_T2EyLEuWYSrwGGXGaOa2PCX9tAVQ3y-oURE3s/edit
After: https://docs.google.com/document/d/1nJcfN_T2EyLEuWYSrwGGXGaOa2PCX9tAVQ3y-oURE3s/preview
Google Drive Web Viewer¶
Simply use https://docs.google.com/viewer?url=FILE_URL. This is will conjure up the file viewer you see when opening things like PDFs, images, etc. that are not native Google Docs files that have their own editor.
Before: https://docs.google.com/document/d/1nJcfN_T2EyLEuWYSrwGGXGaOa2PCX9tAVQ3y-oURE3s/edit?usp=sharing
After: https://docs.google.com/viewer?url=https://docs.google.com/document/d/1nJcfN_T2EyLEuWYSrwGGXGaOa2PCX9tAVQ3y-oURE3s/edit?usp=sharing
Embed Code¶
The following will allow you to embed an item from Google Drive using an IFrame.
<iframe src="https://docs.google.com/document/d/FILE_ID/preview" height="600px" width="800px" allowfullscreen></iframe>
Google Docs Links¶
Direct Download as PDF¶
https://docs.google.com/document/d/DOC_FILE_ID/export?format=pdf
Direct Download as Word Doc¶
https://docs.google.com/document/d/DOC_FILE_ID/export?format=doc
Google Slides Links¶
Direct Download as PDF¶
https://docs.google.com/presentation/d/PRESENTATION_ID/export/pdf
Direct Download as PowerPoint¶
https://docs.google.com/presentation/d/PRESENTATION_ID/export/pptx
Direct Download as PNG¶
This is a bit silly, but you can only download the whole ass presentation as a PDF (see above) or you can do each slide as a PNG. Do note from the web editor, you can download your slides as JPG too.
https://docs.google.com/presentation/d/FILE_ID/export/png?pageid=p10
Google Sheets Links¶
Direct Download as PDF¶
https://docs.google.com/spreadsheets/d/FILE_ID/export?format=pdf
Direct Download as XLSX¶
https://docs.google.com/spreadsheets/d/FILE_ID/export?format=xlsx
Direct Download as CSV¶
https://docs.google.com/spreadsheets/d/FILE_ID/export?format=csv
Google Drawings Links¶
Direct Download as SVG¶
https://docs.google.com/drawings/d/FILE_ID/export/svg
Direct Download as PDF¶
https://docs.google.com/drawings/d/FILE_ID/export/pdf
Direct Download as JPG¶
https://docs.google.com/drawings/d/FILE_ID/export/jpg
Use Google Drawings Inline with HTML¶
Copy a Drive File as Your Own¶
Someone share a file with you, but you want your own copy? Use the following to create a copy with you as the owner.
https://docs.google.com/document/d/FILE_ID/copy