How to Hotlink Images from Google Drive and Dropbox

modify the URL

July 5, 2020

In order to keep the Pantry system resilient, it does not use image hosting which would increase the system’s cost and reduce maintainability. Instead, we use hotlinking which shows images hosted by other websites and apps.

There are generally two kinds of hosting services for image:

1. File hosting

These host files for storage purposes. Examples are:

2. Image hosting

These host images and video for serving over the internet, usually through a CDN (content delivery network). Examples are:

The easiest to use is Imgbb:

  1. Go to imgbb.com and upload your photo

Step 1

  1. Choose don't autodelete

Step 2

  1. Choose HTML thumbnail linked then copy the url referenced by the img tag. In this case, it’s https://i.ibb.co/jvpjXnp/sp.png

Step 3

  1. Paste the link in image field in your Pantry account or Item

Step 4

But what if you already have files on Google Drive or Dropbox?

  1. In Google Drive, share the photo to anyone with the link. This will produce a url, for example:
https://drive.google.com/file/d/1jV8pJUdecO6g3Gemr_GPrHEFKVTMwC0d/view?usp=sharing`
  1. Get the ID which in this case is:
1jV8pJUdecO6g3Gemr_GPrHEFKVTMwC0d
  1. Put that ID to a new URL https://drive.google.com/uc?id= so that the whole URL will be:
https://drive.google.com/uc?id=1jV8pJUdecO6g3Gemr_GPrHEFKVTMwC0d
  1. Copy the link and post into your Pantry Item or Account
  1. Get the link from your image in Dropbox. An example is:
https://www.dropbox.com/s/a6i8y0khkc4us8h/taonet512.png?dl=1
  1. Change the last characters from dl=1 into raw=1
https://www.dropbox.com/s/a6i8y0khkc4us8h/taonet512.png?raw=1
  1. Copy the link and post into your Pantry Item or Account

Register in the Waitlist