Tee
(Tee)
20 באוקטובר, 2023, 5:59am
1
Version: 3.2.0.beta3-dev
in docker self host.
Settings: I set clean orphan uploads grace period hours
to 1 hour.
What i want
Rename the attachment after i uploaded.
1.txt
and 2.txt
is the same file but different file name in below describtions.
Steps
I upload an 1.txt
file to a post, saved.
After 5 minutes, i edit the post and remove 1.txt
link, saved.
I rename 1.txt
to 2.txt
.
I reupload 2.txt
to the post after 1 hour
.
The attachment still name as 1.txt
. NOT 2.txt
.
But in this situation, clean orphan
settings works.
Upload 1.txt
NOT save the post
After 1 hour, i reupload the 2.txt
file
The new attachment link will be 2.txt
when download.
Jagster
(Jakke Lehtonen)
20 באוקטובר, 2023, 6:05am
2
That situation is different thing than clean orphan uploads..
does, isn’t it?
Tee
(Tee)
20 באוקטובר, 2023, 6:15am
3
Perhaps I’m misunderstanding.
As far as I know, the only way to rename the file after uploading is to remove it and wait for Discourse to delete it, and then reupload it.
I followed this guide (edit the posts to remove the attachment links
) to remove the file.
Jagster
(Jakke Lehtonen)
20 באוקטובר, 2023, 6:33am
4
Removing means deleting from harddrive, AFAIK.
But I can confirm this behaviour. Discourse serves old file if it is only renamed (I didn’t bother check if it is really that old file or is it just using old filename with link).
I don’t know anything about code or coding, but Discourse uses somekind hashing I reckon. And as long content doesn’t change name it comes from kind of cache. If you really change that attachement Discourse changes linking too.
4 לייקים