How can I upload files from Google Drive?
Introduction
Image files, or other file resources, located in your Google Drive account can be uploaded into your Overleaf projects using the From External URL feature—provided those Google Drive files have file-sharing enabled. In addition, you will need to create a suitable URL (direct download link) which can be used to add each Google Drive file to your Overleaf projects: this article explains how to do that.
Once uploaded from Google Drive, the corresponding Overleaf project file(s) can be refreshed at any time to resync them with the latest version stored in Google Drive—the video below demonstrates how to do that.
Notes and caveats on changes to Google-based services
File-hosting services, such as Google Drive, can, at any time, make changes to their services; in particular, modifying the structure of link-sharing URLs. For example, in 2021 Google announced a Google Drive security update which added the resourcekey
parameter to their file-sharing URLs. However, due to the nature of this update it seems that not all users (or all their files) will be immediately affected by this change: some Google Drive users will see the resourcekey
parameter, others might not.
Due to such unpredictable changes, it’s impractical for Overleaf to provide consistently up-to-date and fully documented URL-conversion processes for Google Drive or similar services—such guidance could quickly become out-of-date and thus misleading. However, in this page we provide one way to convert Google Drive file-sharing URLs containing the resourcekey
parameter to a direct download URL you can use with Overleaf. Our team has tested this procedure and it worked for us but we cannot guarantee it be relevant to, or work for, everyone. In case of difficulty, readers should, in the first instance, try to find and consult the most current documentation provided by the hosting service(s) they use, or seek out up-to-date articles or YouTube videos.
Sharing a file in Google Drive
Start by identifying a file stored in Google Drive that you want to upload into your Overleaf project:
Next, you need to share that file, to make it accessible outside of Google Drive. The following screenshot, taken on a desktop PC, shows how to access the file-sharing and file-link options within Google Drive:
After you select the option to share the file, a Share with people and groups dialog box appears (see below). From here you can choose to share that file with particular individuals/groups or make it available to anyone who has the appropriate Google Drive link.
Here, we’ll share the file with anyone who has the Google Drive link by changing the link-sharing setting from Restricted to Anyone with the link, as shown in the following screenshot taken from a desktop device (Windows laptop):
After selecting the preferred link-sharing option, we need to obtain a copy of the Google Drive link (URL) to our shared file. There are several ways to do this:
- choose Copy link from the dialog box above (if still visible on your screen), or
- right-click on the file and choose Get link (see screenshot below) then select Copy link from the pop-up box, or
- select the link option displayed to the right (see screenshot below) then select Copy link from the pop-up box.
Creating a direct download URL for Overleaf
After copying the Google Drive link (URL), paste it into a text editor of your choice—because we will use it to derive a direct download URL for use with Overleaf: a URL that Overleaf can use to download the Google Drive file and add it to your project.
After pasting the Google Drive link (URL) into a text editor you should see it has the following structure:
https://drive.google.com/file/d/FILE_ID/view?usp=sharing&resourcekey=RESOURCE_KEY
To construct a download URL we need the following components of the Google Drive link:
FILE_ID
resourcekey=RESOURCE_KEY
Here is an image highlighting the FILE_ID
and RESOURCE_KEY
components:
FILE_ID
and RESOURCE_KEY
are lengthy alpha-numeric character sequences so be careful when you copy them to avoid missing/dropping any characters.
Having extracted the FILE_ID
and RESOURCE_KEY
, use the following template to construct the download URL for Overleaf:
https://drive.google.com/uc?export=download&id=FILE_ID&resourcekey=RESOURCE_KEY
Here is an image highlighting use of the FILE_ID
and RESOURCE_KEY
components within the constructed download URL:
You are now ready to upload the Google Drive file to your Overleaf project.
Uploading the Google Drive file into an Overleaf project
To use the download URL, select Overleaf’s file upload feature and choose From External URL:
Paste in the download URL, give the file a name and select Create to add (upload) your Google Drive file to an Overleaf project.
Video showing Google Drive file upload
The following video demonstrates use of a download URL to add a Google Drive file into an Overleaf project.
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Using the Overleaf project menu
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Using the History feature
- Debugging Compilation timeout errors
- How-to guides
- Guide to Overleaf’s premium features
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Matrices
- Fractions and Binomials
- Aligning equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
- Using the Symbol Palette in Overleaf
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management with bibtex
- Bibliography management with natbib
- Bibliography management with biblatex
- Bibtex bibliography styles
- Natbib bibliography styles
- Natbib citation styles
- Biblatex bibliography styles
- Biblatex citation styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- Multilingual typesetting on Overleaf using babel and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections, equations and floats
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in LaTeX
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typesetting exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class