Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

image stored in dropbox

160 views
Skip to first unread message

LL

unread,
Aug 28, 2021, 11:58:00 AM8/28/21
to oTree help & discussion
Hi,

sorry for this stupid quesition, but I need help displaying a picture stored in a cloud (e.g. dropbox)

Until now I just stored them in the static folder. But someone told me that for deploying to Heroku it is better to store the pictures in a cloud.

However, it doesn't work.

i have this in my template:

but instead of the picture, there is just a little square.

What is the problem here?

thanks so much ahead!

BR,
LL

Chris @ oTree

unread,
Aug 28, 2021, 12:07:59 PM8/28/21
to oTree help & discussion
Here is a similar question: https://www.dropboxforum.com/t5/Dropbox-files-folders/How-do-I-embed-images-with-a-direct-link-from-Dropbox/td-p/245432

Based on that advice, try this URL:


Although the link you posted looks like the URL of the image (based on the .jpg extension), it is actually the URL of a webpage (that contains the image, among various other content). On the other hand, the raw link consists of just the image, no text etc.

LL

unread,
Aug 28, 2021, 12:19:13 PM8/28/21
to oTree help & discussion
Thank you so much!

It works now.

Unfortunately, the page loads the picture much slower now...

BonnEconLab

unread,
Aug 29, 2021, 6:48:08 AM8/29/21
to oTree help & discussion
Hi LL,

You wrote,

> But someone told me that for deploying to Heroku it is better to store the pictures in a cloud.

What was the reason that this someone gave? I can think of two:
  1. You want to be able to edit the image for some reason without having to re-upload it to Heroku.
  2. Bandwidth, that is download speed: One might suspect that Dropbox serves the image faster than Heroku. This is an empirical question. In your case, it turns out that Heroku serves the image faster than Dropbox does. So, this reason turns out to speak against using Dropbox.
Another reason that speaks against storing the image in Dropbox, in my view, is that you are more likely to accidentally remove it from there than from oTree’s static folder (at least I would be).

Best,

Holger

LL

unread,
Aug 30, 2021, 11:27:29 AM8/30/21
to oTree help & discussion
Hi Holger,

The reason was number 2, the bandwidth.

Actually, it is not in Heroku yet. I am trying to deploy it. 
Right now it is slow on the local server on the Demo page..

BR, 
LL

ccr...@gmail.com

unread,
Sep 1, 2021, 8:03:14 PM9/1/21
to oTree help & discussion
Hi all -

I am facing a similar problem where I am hosting an image-heavy app, currently on a university server using oTree's static folder.  As it is suggested, though, when many users are being run at once this isn't sufficient and the images start to load much more slowly (especially for subjects far away from the university's physical location).

Does anybody have suggestions of a free (or cheap) host which easily allows for hotlinking like this?  Google drive and photos make it very hard to do.  LL above suggests that dropbox is slow using this workaround.  What other options are there?

Thanks,
--Chris

Chris @ oTree

unread,
Sep 1, 2021, 8:18:54 PM9/1/21
to oTree help & discussion
Amazon S3 is a reliable solution. And you can use it together with CloudFront for optimized worldwide performance.
Reply all
Reply to author
Forward
0 new messages