Report this

What is the reason for this report?

Odd Image Loading Question - Images Return 403 After 1-2 Hours of Loading Fine. URL Expires?

Posted on September 27, 2021

I have a django site that allows image uploads from the admin panel via summernote. These images are all stored in a Spaces folder. There are no problems uploading images.

After uploading I can view the site and the images are there with no problem. However if I was 1-2 hours and check again, the pictures return a 403 error.

While it’s up I can copy the image link and put it into a URL and the picture loads fine. Once the 1-2 hours is up, that doesn’t work anymore.

It’s like there is some sort of active timer set on the photos or something?

Looking at my URL for the image it does seem to have some sort of expiration code. But I’m not sure how to make that go away.

https://sfo3.digitaloceanspaces.com/<my project folder>/django-summernote/2021-09-25/a361e3aa-ea6e-4328-92b9-e9ffc2cc3ca3.png?AWSAccessKeyId=<access id> &Signature=><signature>&Expires=1632614952



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.

It sounds like you are utilizing pre-signed URLs for your images on DigitalOcean Spaces. These URLs are generated with an expiration time for access, which seems to align with the timer you’re noticing.

To solve this issue, you should either generate the pre-signed URLs with a longer expiration time or consider making your content publicly available, so you don’t need to use pre-signed URLs to access the content. Of course, consider your privacy and security needs carefully before making content public.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.