It is possible to view an old Attachment?
Asked by Kratofil:

Hi,

I've uploaded 2 images with the same filename, so I got 2 different versions of it.

Is it possible to view version 1?

I think it should be possible, but how? because all the versions have different file sizes and they are all stored on the server?

I've added an example:

![Unbenannt.PNG](/t5/image/serverpage/image-id/7628iE2E579DE09B341C6/image-size/large?v=v2&px=999 "Unbenannt.PNG")

I only would like to see the version 1?

My problem is, if I clicked on version1 I only get the actual image (version 2).

I've got no chance to see what was version 1.

Thanks in advance

Best Regards


Answers:
author: Kashev Dalmia _Soteri_
body: If anyone else comes across this - this is a bug in Confluence \*specific to JPG\*s.

<https://confluence.atlassian.com/confkb/how-to-retrieve-older-version-of-jpg-attachments-980462119.html>


author: AnnWorley
body: [@Kratofil](/t5/user/viewprofilepage/user-id/1156382) The attachments seem to be in a strange directory, but it is as expected. Please see: [Hierarchical File System Attachment Storage](https://confluence.atlassian.com/doc/hierarchical-file-system-attachment-storage-704578486.html)  
I suspect an indexing issue. Please try reindexing from this guide:  
[Content Index Administration](https://confluence.atlassian.com/display/DOC/Content+Index+Administration) and if that doesn't work, rebuilding the content indexes from scratch as described in [How to Rebuild the Content Indexes From Scratch on Confluence Server.](https://confluence.atlassian.com/confkb/how-to-rebuild-the-content-indexes-from-scratch-on-confluence-server-110035351.html)

[@Thomas Schlegel](/t5/user/viewprofilepage/user-id/781483) I appreciate all the testing and work you did on this Question.

comments: author: Kratofil
body: Hello [@AnnWorley](/t5/user/viewprofilepage/user-id/502040), thank you for your response.

I've checked all the prospects you mentioned, but nothing helps.

The Attachment Storage seems to be correct, also I've tried reindexing from scratch you mentioned.

The issue is there.

I've found out, that the problem only comes up, if I try to "update" a ".jpg" file. If I check version 1 it's the same like version 2.

But if I use a ".png" file, or something else (pdf, doc, xls), the version history works fine. (Version 1 isn't Version 2 then)

Very strange behavior.

Do you have any other solutions? Or is it possible that you could take a look at this problem on the server itself ?

Or maybe it's a general problem with this server version?

Many Thanks in advance!

Thank you [@Thomas Schlegel](/t5/user/viewprofilepage/user-id/781483), I've try to update here if I get a working solution.


author: Kratofil
body: I've tried something to figure out the problem.

I've installed a new and clean version of the confluence server 6.4.3 on a new installed operating system (Linux Ubuntu 16.04.3 LTS).

There I haven't setup anything different like the factory settings and tried the same process as mentioned before:

upload a new jpg with the name test1.jpg, edited the picture on my computer, afterwords save it and upload it again with the same name test1.jpg.

at confluence I couldn't download at the attachments site the different versions.

I've found out, if I view the file with click on it (Pictureviewer in confluence): ![Version vergleich pictureviewer confluence.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/8458i33A4DDF487034195/image-size/large?v=v2&px=999 "Version vergleich pictureviewer confluence.PNG")

I could have a look at version 1 (**the right one!**).

But if I go to the attachments site, I can't see the right version of "version1", there I only get version 2 (although there are 2 different files)

![Anhang.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/8460i5226EEC37172E591/image-size/large?v=v2&px=999 "Anhang.PNG")

Then I've found something new:

If I click on the picture to open up the pictureviewer and do rightclick in my browser on it -\> open in another tab (to get the full link of the picture) it shows me this one:

Version1:

http://...:8090/download/attachments/327693/try1.jpg?version=1\&modificationDate=1509269853500\&api=v2

Version 2:

http://...:8090/download/attachments/327693/try1.jpg?version=2\&modificationDate=1509269909261\&api=v2

But if I go over the attachments site, and open the picture here, I've got following link:

Version1:

http://...:8090/download/attachments/327693/try1.jpg?version=1\&**amp;** modificationDate=1509269853500\&**amp;**api=v2

Version 2:

http://...:8090/download/attachments/327693/try1.jpg?version=2\&**amp;** modificationDate=1509269909261\&**amp;**api=v2

The different here I've marked in bold (way over pictureviewer, there isn't any "amp;" in the link, but at the attachments site, there is?!)

Next very curious behavior is:

If I open like the way over attachments site and edit the link manual (remove the "amp;" that I've get the link like way over picture viewer) and load it, I've got the right version!

**BUT**: If i edit manual the link, remove the "amp;", load the site, and want to have a look way over the picture viewer like this:

![Version vergleich pictureviewer confluence.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/8461iAE1EF14AB7B8A430/image-size/large?v=v2&px=999 "Version vergleich pictureviewer confluence.PNG")I cant get the right one of "Version 1". After this manual edit of the link, you can't get Version 1 without accessing the file system and search for it...

I think there is maybe a problem with the api?

I hope this helps a little bit to find any solutions for this problem.

Many thanks in advance!!


author: AnnWorley
body: Thanks to you for digging so deeply into this. When I tested originally, I used a rich text file and I could still view the old attachment version as expected.

But trying again today with a .jpg image, I am experiencing the behavior you reported. I couldn't believe no one noticed before so I searched for a bug report and found [Uploading multiple images with duplicate filename shows incorrectly during editing](https://jira.atlassian.com/browse/CONFSERVER-37093)which seems to be the same root issue.

I am linking this thread in a private comment on the bug. Any details you wish to add will be valuable feedback. If you do vote or comment you will be added to notifications for the bug.


author: Thomas Schlegel
body: [@AnnWorley](/t5/user/viewprofilepage/user-id/502040)

[@Shannon S](/t5/user/viewprofilepage/user-id/510046)

Are you able to help [@Kratofil](/t5/user/viewprofilepage/user-id/1156382) ?


author: Thomas Schlegel
body: Hi,

it works exactly as you described. If you click on "Version 1" you'll see the old version of the image. I've just tried, just to be sure, and this works for me.

comments: author: Thomas Schlegel
body: What happens, if you click with the right mouse button on "Version 1", copy the link and open it in another browser? Maybe there's a problem with the browser's cache.


author: Kratofil
body: Hi Thomas thanks for your quick response.

I've tried it already on different browsers. Also like you mentioned I copied the link and opened it in another browser, but the result is exactly the same. I get the actual Version (Version 2). So it might be not a cache problem.


author: Thomas Schlegel
body: If you save both versions, do they have the same (different) filesize as showing in the attachement's view?


author: Kratofil
body: They have all the same filesize like the actual Version.

I've tried it yet in another space, just for testing. And there is also the same problem. Just created a image again, edited it afterwords and uploaded it again.

I've downloaded there too all images, they have also the same filesize and the same content


author: Thomas Schlegel
body: that's strange. I think, you have already checked whether the urls for version 1 and version 2 are different?

Do you see something in the logfiles?

Are you able to look at the server directly? Could you please check, if there are two different files in your confluence home/attachments folder?


author: Kratofil
body: File 1:

http://confluence/download/attachments/328030/test.jpg?version=1\&amp;modificationDate=1507808520341\&amp;api=v2

File 1, but modified ( version 3):

http://confluence/download/attachments/328030/test.jpg?version=3\&amp;modificationDate=1507809861698\&amp;api=v2

About logfiles, I've searched for the name of the file, but I have to say, that I don't know exactly where I have to look for. Could you please give me some advice?

Yes I'm able to, on the server itselfs I found two different files of my test image, but in a very strange directory ../home/attachments/ver003/79/89/589829/.../../../1.jpg and 2.jpg, this would be the 2 pictures it shows me on confluence itself. But if I opened it on confluence, i couldn't get the two different ones.


author: Thomas Schlegel
body: Michael, I think I reached the end of what I can do here for you. I have no idea, what is going wrong on your side, I'm sorry.

Please contact Atlassian Support with this error. They can have a deeper look into your environment and hopefully are able to help you:

<https://support.atlassian.com/contact/#/>

If you found out, what is going wrong, please post the solution here. This is a good information for other users with similar problems.

Good luck

Thomas


author: Kratofil
body: No problem Thomas, many thanks.

I've tried it already over the Atlassian Support but they dont offer personal support for Starter Licenses and thats why I'm here.

But before I upgrade the license to an higher one, I would like to test everything. Do you know anything what I can do now ?


Tags: attachment