30
Views
0
Comments
[GetMimeTypes by Magic Numbers] Error checking the mime type of a zip file
Question
getmimetypes-by-magic-numbers
Service icon
Forge asset by Rui Félix
Application Type
Service
Service Studio Version
11.54.49 (Build 63182)

We are receiving an error when we check the mime type of a zip file that contains PDFs with Chinese characters in the names. It looks like the extension is checking the mime types for all files in the zip archive and creating a dictionary structure for the file names but not creating the keys using unicode characters.

Is there a workaround?

This is the error:

"Item has already been added. Key in dictionary: '0005/YPD24003995/????????????/?????????100u.pdf'  Key being added: '0005/YPD24003995/????????????/?????????100u.pdf'    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)

   at System.Collections.Specialized.OrderedDictionary.Add(Object key, Object value)

   at MS.Internal.IO.Zip.ZipIOCentralDirectoryBlock.ParseRecord(BinaryReader reader, Int64 centralDirectoryOffset, Int32 centralDirectoryCount, Int64 expectedCentralDirectorySize)

   at MS.Internal.IO.Zip.ZipIOCentralDirectoryBlock.SeekableLoad(ZipIOBlockManager blockManager)

   at MS.Internal.IO.Zip.ZipIOBlockManager.get_CentralDirectoryBlock()

   at MS.Internal.IO.Zip.ZipArchive.GetFiles()

   at System.IO.Packaging.ZipPackage.ContentTypeHelper..ctor(ZipArchive zipArchive, IgnoredItemHelper ignoredItemHelper)

   at System.IO.Packaging.ZipPackage..ctor(Stream s, FileMode mode, FileAccess access, Boolean streaming)

   at System.IO.Packaging.Package.Open(Stream stream, FileMode packageMode, FileAccess packageAccess, Boolean streaming)

   at OutSystems.NssGetMimeTypes_ByMagicNumbers.CssGetMimeTypes_ByMagicNumbers.MssGetFileMimeTypes(Byte[] ssContent, RLFileTypeRecordList& ssFileTypeList, String& ssErrorMessage)"

   

This appears to be when the extension thinks there is a duplicate.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.