Replace Images

Status: Idea Submitted

Status history

I was shocked today to find out that using the function in the file manager to ‘Replace’ an image does in fact do nothing of the sort!

Rather than replacing the image in all of its applications within the system, it instead creates a duplicate using the same filename that DOES NOT replace the image in any of its application within the system.

This seems like a fundamental flaw in the either the functionality or if not, an error in the labelling of the action. Actually being able to replace an image would be incredibly useful. Granted there may be the need to include a ‘Are you sure!’ warning similar to when making changes to a template but I believe this would be avery useful option to have. Frankly I’m surprised no-one has highlighted this previously.

Replace has worked for me, though it doesn’t always appear to. The initial image is often cached, so even if you go replace the image in the file manager THEN re-add the edited image, sometimes it will still show the first image. I just verify in incognito or send it to someone else to verify.

I have had this issue with both Files and Images. If I cannot see that the new file is being shown, how many of my customers are seeing the old content? Thie requires a fix. I cleared my cache, refreshed, and the incognito trick worked.

@hubspot -- please FIX!!

Empty

Not sure why this has been “being reviewed” for over a year - I have the same problem. I’ve “replaced” images and nothing happens for ages, and then when I go into, say, the email editor to update the image (because it’s not showing as changed) the image appears to have changed (in the image selection drawer it shows as being the new image) and then when I go to use it, the old image populates. Really bizarre. Pretty basic fuctionality that just doesn’t seem to work well at all. Even clearing the cache and waiting a few days, it’s not done.

Well this explains a lot of what I was seeing today when I was updating images to reduce file size! Glad I am not crazy, but disappointed that I need to go update every instance of these images. :disappointed_face:

It seems a pretty simple feature but it does not work. @hubspot Please upgrade the priority for solving this issue.

We have used the replace function for files and images for quite some time and not have had an issue - at least not for our customers or new users, internally it has created a lot of confusion and back-and-forth because of caching. did you update? yes. oh, it’s my cache. ugh!

This really needs to be fixed.
This happens when I replace the image at the file level, instead of just using a different image on a different URL and replacing the URL on the blog post. I can unpublish and republish the post, log out of HubSpot, clear MY cache, etc… The preview is correct and in the browser, the image is wrong. I can have someone look at it on a different browser, etc, but the old image file still shows. Example: I sent the link to my live blog post to a coworker via Slack. Inside Slack, the preview displays the correct image, but in the browser, it’s still the old image.
As I recall it has to wait for HubSpot to clear that cache. So in a few hours or overnight (I don’t recall how long this takes) the post will be correct. But, in the meantime, everyone who visits our post is seeing the wrong image. NOT GOOD. Why bother to allow us to replace the image file if it won’t update automatically? OR, why not tell us when we do this that the new image won’t display? This is going on 3 years ago that this was reported.

Hi - I’m trying to replace images in my Files directory, but when uploading edited images with same name, Hubspot creates a duplicate with the extension -1 to the image name. How do I even replace an image aside from the problems of showing the replaced image?

@TRCH you have to open the file preview to access the replace button, you can see it in the lower left here

Thanks @Jnix284 - can images be replaced in bulks?

Hi @TRCH , no, that’s also part of the issue with the current “replace” tool, it is one-by-one, otherwise it creates the renamed files with the -1 as you experienced. You can see the workaround I have provided here.

I noticed this issue while combing through our backlog. I work on the hubspot CDN and hope I can provide some clarity on this issue. What I believe is happening in most of these cases is that your browser is caching the old url to the file. When a public file is served from our CDN, it returns cache tag headers like this:

cache-control: s-maxage=1814400, max-age=1209600, stale-while-revalidate=900

which indicates that our CND regional edge caches will cache the file for 21 days and is telling your browser to cache it in its local cache for 14 days (times are in seconds). We have mechanisms in place to purge our CDN cahce a few seconds after a file is updated or deleted. However, your browser has no way of knowing that a given url has been modified, so it will continue serving the old file from your local browser cache for up to 14 days. You can see this in action by opening the network pannel in your browser’s debugger and seeing which urls are loaded from disk cache. There is a “disable cache” checkbox that will allow you to load each resource from origin. Note that the cache is only disabled while devtools is open. As mentioned earlier, you can also empty the cache or hard reload the page in question to refectch each resource from origin as well. Hope this helps

Commenting on behalf of a customer who is using the File upload feature on HubSpot to upload images for their vendors. It is an issue when the images do not load due to caching and the vendors have to manually clear cache or hard reload the page!

This thread talks mainly about replacing images. Does replacing PDFs work ok, or are there the same pitfalls?

@TRichards8

Caching and invalidation for all files works the same way as I explained above. However we have increased the shared cache time to 30 days since I last commented. We could explore reducing the local (browser) cache time so that clients pick up changes sooner

Thank you for the update @MichaelMcGaha, wouldn’t increasing from 21 days to 30 days make this issue worse? and if so, then shouldn’t the 14 days be reudced (as you mentioned)? There would be absolutely no benefit to the “replace” feature at this point - if you need an updated file, you’d be forced to load a new file and update all of your links (possibly redirect from the old file name to the new file name if it was used in email). Which brings me to my next question - if you replace the image, and also rename it (creating an automatic redirect), would that force the cache to reset?

It looks like this was reported a long time ago and just stating that in May 2024 it is still problem and a bit stressful when trying to get content approved and needing to assure everyone that it will be ok when published. I did replace for an image and am still seeing the old one. I’d rather do this than muck up the files with duplicates or unneeded ones. Deleting and adding a new one doesn’t help either unless there is a net new file name.

Hi everyone!
This idea’s status has changed from ‘Being Reviewed’ to ‘Idea Submitted’. This change is due to our improvement project to update our Ideas Forum statuses in order to provide better transparency into how we are listening to your feedback.

“Idea Submitted” means that our product teams are aware of this feedback and are monitoring the need for this feature alongside other inputs that determine their priorities & roadmap.

For more details about the statuses we use on the Ideas Forum & what they mean, you can read this community post here.