# Wanneer S3 wordt geannuleerd, moeten afbeeldingslinks of bestandlinks automatisch het lokale pad weergeven

**URL:** https://meta.discourse.org/t/when-s3-is-canceled-image-links-or-file-links-should-automatically-show-the-local-path/312291
**Category:** Self-hosting
**Tags:** uploads, s3
**Created:** [16 juni 2024 om 18:52 UTC](https://meta.discourse.org/t/when-s3-is-canceled-image-links-or-file-links-should-automatically-show-the-local-path/312291 "2024-06-16T18:52:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kuaza](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuaza/32/264151_2.png) [@kuaza](https://meta.discourse.org/u/kuaza)
#### Post date: [16 juni 2024 om 18:52 UTC](https://meta.discourse.org/t/when-s3-is-canceled-image-links-or-file-links-should-automatically-show-the-local-path/312291/1 "2024-06-16T18:52:36Z")

</div>

Why are the image links replaced with the original S3 link when I cancel the S3? That is, [cdn.domain.com](http://cdn.domain.com) cdn url only turns into image links such as [qsdqdqsdqsd.qsdsqdqsdqs.cloudflare.com](http://qsdqdqsdqsd.qsdsqdqsdqs.cloudflare.com). It would be good if we could solve this once and for all. After S3 is canceled, we should be able to convert topic links and image urls to local urls. I tried everything on the forum and it didn’t work and I had to use cdn again. So if anyone has a different technique, I’d be happy to listen.

_I downloaded the images and uploaded them manually to locale. I just couldn’t fix the links on the site and I saw that the browser was still trying to upload to S3 even though I deleted the cache._

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [16 juni 2024 om 23:42 UTC](https://meta.discourse.org/t/when-s3-is-canceled-image-links-or-file-links-should-automatically-show-the-local-path/312291/2 "2024-06-16T23:42:59Z")

</div>

You’ll need to update the path in the uploads model to point to the local url and rebake the posts.

---

<div class="post-metadata">

### Author: ![kuaza](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuaza/32/264151_2.png) [@kuaza](https://meta.discourse.org/u/kuaza)
#### Post date: [20 juni 2024 om 16:04 UTC](https://meta.discourse.org/t/when-s3-is-canceled-image-links-or-file-links-should-automatically-show-the-local-path/312291/3 "2024-06-20T16:04:35Z")

</div>

I don’t want to tire you out, but can you write here how to do this? Because when I couldn’t do it, I tried everything I found and made the site worse. 🙏 🙏

Ahh, I think this is what you’re talking about. I will try this, thanks:

> [@Migrating uploads from S3 to local](https://meta.discourse.org/t/migrating-uploads-from-s3-to-local/163903/31):
>
> Getting the files to your server is just (the easy) part of the problem. You can look at the uploads with cd /var/discourse ./launcher enter app rails c Upload.pluck(:url) That’ll show you the URLs of your uploads. Then you need to modify all of those uploads so that they have the new path to your new bucket. You can try searching for the remap command. I think it might work I’m not sure what this means.
