0

I have deleted some PDFs from the Sitecore media library by replacing them with new PDFs which were already added to the library. As a result, the media URL is now changed. The owner now says they forgot to mention that they want to retain the old URL. Is it possible to retrieve the old files and thus their URLs, or force the old URLs on the new files?

1

As mentioned here already, the Recycle Bin is keeping deleted files.

If you want to change the pdf that is attached to the media item, you can detach it and attach a new one - this will change the pdf but the item (and the url) will stay the same.

Info about the attach/detach can be found here: https://www.techguilds.com/Blog/2018/06/managing-the-sitecore-media-library enter image description hereenter image description here

However, be careful!

The pdf is probably cached on several places. You wouldn't be the first one to ask (here or on other community channels) why people still see the old pdf although in Sitecore there is a new one... In my humble opinion, it is actually a bad idea to keep the url. If it is a new document (or a new version of the document), you should give it it's own url.

Note that Sitecore also supports versioned media items. You can choose this when uploading the asset. With this media type, you can actually create new versions (just like with most items in Sitecore) of the media asset. There is also a setting (Media.AlwaysAppendRevision) you can use to generate different urls per revision.

0

Sitecore move deleted files in Recycle Bin and keep it there for some time. I think you can look into Recycle and restore it from there.

See this link to know how to restore or remove a deleted item

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.