Not sure this is possible since the actual file is not versioned if I am correct!? It is the IContent that is versioned and not the file it self so you will need to get the binary data for the old version somhow.
I found this thread that has your problem as well. Maybe it can assist?
Yeah, I tested so far that I can get the blob of the older version of the file and open a stream to it.
Mostly wanted to know if there is a built in way to access the older versions.
No as far as i know it is not any specific api for this at the moment from epi.
I solved it by creating a partial router for a content version, which allows older versions to be downloaded with URLs like "/globalassets/file.txt/X" where X is the WorkID version on the ContentReference.
For anyone else which might need this the code was added to github: https://github.com/trembon/EPiServer.CJansson.MediaDataVersionRouter
Hello,
I was looking into with generating a list to show the version history of files in Episerver, which is no problem with the IContentVersionRepository.
My problem though is to generate the download links for the files that have older versions. Even if I send the ContentVersion.ContentLink to the UrlResolver I still get the url for the latest version of the file.
Also, if I select an older version in the Version gadget for the file all the links in Episerver still points to the latest version of the file.
So, is this possible out of the box in Episerver? I know I could build some http handler and return the stream of the old blob, but wanted to this the "standard" way if there is any.
// Christopher