Search code examples
sitecoresitecore7

Sitecore - Upload two file with same name but different extension inside a zip file


I want to upload 2 files with same name but different extension, i want to put them inside a zip file and then use sitecore to extract all the files into the sitecore media library.
I'm using sitecore 7.2. Any idea how to do this?


Solution

  • You can use the Upload Files (Advanced) option and then select the Unpack ZIP Archives in the upload dialog.

    Upload Files (Advanced)

    Unpack ZIP

    The file will be uploaded, the archived unpacked and resulting files individually listed as separate items:

    Upload Files with same name

    The issue you have with the above is that Sitecore is very "flexible" (ahem) with what it allows as an item extension, therefore it cannot resolve both of these items, since they both have the same Item name.

    You can either set Media.IncludeExtensionsInItemNames=true in config or extend the MediaRequestHandler to make additional checks for the extension: Handling Duplicate Media Paths in Sitecore.

    There's more info about this behaviour in this previous Stackoverflow question.

    NOTE: The Unpack ZIP archives does not appear to be working in Sitecore 8, Update 4 (possibly all). I will raise it as a bug with support.