After deleting the page attachment, I can still preview PDF through the preview link
Asked by Ollie Guan:

Hello Community,

I encountered a problem while deleting the attachment Before deleting, I recorded the attachment preview link.

After deleting the attachment, I can still preview the attachment through this link, but I can't download it anymore. I know that some temporary files are stored in $share_home/viewfile. Do I have to clear this directory?

What is the reason for this kind of situation?


Answers:
author: Thiago Masutti
body: Hi [@Ollie Guan](/t5/user/viewprofilepage/user-id/853638) and [@Dominic Lagger](/t5/user/viewprofilepage/user-id/601600)

This is the actual behavior of Confluence.

When an attachment is first previewed, this preview file is cached in the file system as described in [this KB](https://confluence.atlassian.com/confkb/how-to-rebuild-the-file-preview-cache-from-scratch-in-confluence-765756128.html).

When an attachment is deleted, and sent to the trash, the preview file isn't removed. Therefore, a user that had the URL to that preview could still access it.

The preview files are deleted when the attachment is purged from the trash.

Let me know if you consider this should work differently and I can log a feature request for it.

Kind regards,  
Thiago Masutti

comments: author: Ollie Guan
body: Thanks [@Thiago Masutti](/t5/user/viewprofilepage/user-id/1209618) [@Dominic Lagger](/t5/user/viewprofilepage/user-id/601600)

We have contacted the technical support team and create a ticket to track this issue.

<https://jira.atlassian.com/browse/CONFSERVER-64856>


author: Dominic Lagger
body: Thanks for the information.

But when [@Thiago Masutti](/t5/user/viewprofilepage/user-id/1209618) said, that this is the normal behaviour in confluence, then why is it declared as a bug? Shouldn't it be a feature request?


author: Thiago Masutti
body: Hey [@Ollie Guan](/t5/user/viewprofilepage/user-id/853638) [@Dominic Lagger](/t5/user/viewprofilepage/user-id/601600)

The support team opened the bug and made some internal comments.  
Although Confluence is operating *as designed*, this really seem to be a bug and the product team should be able to give us better details.

I've made some internal comments there to the product team.

Let's watch the bug and see how it progress.

Kind regards,  
Thiago Masutti


author: Dominic Lagger
body: Hi [@Ollie Guan](/t5/user/viewprofilepage/user-id/853638)

I can confirm this behaviour and I have no clue why this is...

I am quite confused.  
Maybe Atlassian support can help you.

I'll watching this post.

Regards, Dominic


author: Ollie Guan
body: If the page is deleted, it will prompt that the page does not exist or has been deleted when accessed through the link. Why is the attachment handled differently?

Deleting attachments means that the administrator does not want these attachments to be accessed by users in any way.


author: Ollie Guan
body: I tried several methods,

1. Clear $share_home/viewfile  
2. Rebuild the index  
3. Restart the node  
4. Flush all in Cache Statistics  
5. Clear the browser cache

Unless the attachment is completely removed from the recycle bin, the preview is still visible.

But this is different from our expectations.In some specific scenarios, we expect to temporarily store them in the recycle bin instead of deleting them directly.


Tags: confluence-server

data-center

server