Online storage services are currently popular for storing files online. Most popular services include Dropbox, Google Drive, Google Docs, Box, Sharepoint, and many others. On this page, we have gathered a few simple steps on how to manually create a direct download (raw content) URL for files from various online storage providers, such as Dropbox, Google Drive, Box, and Amazon S3.

IMPORTANT: No need for this article if you use PDF.co because it automatically understands links for Google Docs, Google Sheets, Google Slides, Google Drive, Dropbox! Just make sure that your link is available as “anyone with a link” or in “shared via a link” mode.

Need secure storage for files you use with API? The built-in PDF.co’s Files storage provides secure file storage you can use to put input files, images, documents securely for re-use in PDF.co and its plugins like Zapier, Integromat, and others! The built-in storage is available here for all PDF.co subscribers

Not using PDF.co? Find how to transform links manually below

Creating Direct Link For Dropbox files

First, you need to make your file available via a public link. To do this you need to right-click on the file and select “Copy Public Link“. This will generate a public link for this specific file. This link usually leads to a page where you can preview a file before downloading it.

To create a direct link for downloading this file rather than displaying it first, just add ?dl=1 to the link. For example:

https://www.dropbox.com/s/a1b2c3d4ef5gh6/example.docx?dl=1

Sometimes a link may already contain ?dl=0 at the end. In this case, just replace it with?dl=1

Creating Direct Links For Google Drive files

First, the file should be shared as “anyone with a link”. In this case link to a file that looks like this

https://drive.google.com/file/d/file_id/view?usp=sharing

Where file_id is a unique long string of letters and numbers for this specific file.

To change the link to point into direct download you need to cut this file_id identifier and build the following URL:

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

WARNING: Google applies to throttle (force limiting downloads and/or download speed) if you are accessing files too often. In this case, Google Drive returns an HTML page with “sorry can not download or view file at this time”, here is the discussion on Stackoverflow. If you need to make sure that input files are accessible, please use built-in PDF.co File Storage.

Creating Direct Links For Google Documents, Google Sheets and Google Slides documents for use by PDF.co

First, the document should be shared in “anyone with a link” mode. In this case link to a file looks like this

Google Docs: https://docs.google.com/document/d/file_id/view

Google Sheets: https://docs.google.com/spreadsheets/d/file_id/view

Google Slides: https://docs.google.com/slides/d/file_id/view

This file_id string (which is made of a long string with randomly mixed letters and numbers unique for this specific document) should be used to create a manual link that should be formed as the following

  • Google Docs (Documents): https://docs.google.com/document/d/file_id/export?format=pdf
  • Google Sheets (Spreadsheets): https://docs.google.com/spreadsheets/d/file_id/export?format=xlsx
  • Google Slides (Presentation): https://docs.google.com/presentation/d/file_id/export/pdf

WARNING: Google applies to throttle (force limiting downloads and/or download speed) if you are accessing files too often. In this case, Google Drive returns an HTML page with “sorry can not download or view file at this time”, here is the discussion on Stackoverflow. If you need to make sure that input files are accessible, please use built-in PDF.co File Storage.

Get a link for a PDF version of your Google Docs or Google Sheets (no PDF.co is required)

If you need to just get a PDF version of your Google Docs document or Google Sheet spreadsheet then you do not require any online services at all actually. Just create the link as instructed below:

You may need to log in to your Google Docs or Google Sheets account to get a PDF version of your document. If you want to share a link to this document then you either need to open access to this person or share your document/spreadsheet in “anyone with link” mode.

First, take a look at the link you have. Links to documents and spreadsheets on Google Docs and Google Sheets look like this:

Google Docs: https://docs.google.com/document/d/file_id/view

Google Sheets: https://docs.google.com/spreadsheets/d/file_id/view

Google Slides: https://docs.google.com/slides/d/file_id/view

This file_id string (that is made of randomly mixed letters and numbers) should be copied and used to create new a manual link that should be formed as the following

  • Google Docs (Documents): https://docs.google.com/document/d/file_id/export?format=pdf
  • Google Sheets (Spreadsheets): https://docs.google.com/spreadsheets/d/file_id/export?format=pdf
  • Google Slides (Presentation): https://docs.google.com/presentation/d/file_id/export/pdf

Hooray! If you did everything correctly then your new link will return a PDF version of your document.

P.S.: if you need to convert PDF to images, need to fill pdf forms, extract data from PDF then we suggest you try PDF.co that can do this. Otherwise, no other services are needed to get a PDF version of your doc.

Creating a direct link for a file stored in Box online service

Direct links are a premium feature in Box, unavailable on free personal accounts.

At the bottom of the shared link settings pop-up, you will find a direct link to your file. A direct link is a web address (URL) that links directly to a file (without using Box Preview).

Please refer to their documentation for more information.

Creating a direct link for files stored on Amazon S3

If you create a bucket named mybucket in the US West (Oregon) Region, and you want to access the invoice.pdf object in that bucket, you can use the following path-style URL:

https://s3.us-west-2.amazonaws.com/mybucket/invoice.pdf

Creating a direct link for files stored on Sharepoint

If you need to create a direct download link for a file on the Microsoft Sharepoint server then please try the following template for your link:

https://SITE.sharepoint.com/:x:/r/sites/SITENAME/FOLDERNAME/FILENAME.EXT?download=1

Verify this link in the “Incognito” browser window. If it does not work then try this template instead:

If you need to create a direct download link for a file on OneDrive online storage server then please try the following:

  • Open OneDrive and select a file you want to get the link for.
  • Right-click on the file and select the “Embed” option.
  • This will display the code for embedding, something like this:

    <iframe src=”https://onedrive.live.com/embed?cid=12345&authkey=6789″ width=”100″ height=”100″ frameborder=”0″ scrolling=”no”></iframe>
  • Now select and copy the link from the “src” parameter, the link will look like this: https://onedrive.live.com/embed?cid=12345&authkey=6789.
  • Finally, in this link, replace “embed” with the “download” so your final direct link will look like this:

    https://onedrive.live.com/download?cid=12345&authkey=6789

Verify this link in the “Incognito” window in your browser to make sure it works without login and password required.

Read More:

How to connect Zapier to PDF.co

PDF.co & Zapier tutorials

Getting Started with pre-made Zaps

Related Pages: