Hey together,
I've got a little problem with the ZipPackage in the Telerik.Windows.Zip library.
I'm developing in a Silverlight environment (Silverlight Business Application). On the server side I zip a user specified amount of files (which are stored in a Microsoft SQL database).
At first a little code snippet:
As you can see, I store the ZipPackage in a MemoryStream. After the "using" code block I return the content of the MemoryStream (ms) back to the client side of my application (the above procedure is called due to an InvokeOperation). On the client side, the returned byte array will be stored under a user specified filename in the local file system. This works really proper, but after opening the stored zip file, I see, that filenames (containing german umlauts like ä, ö, ü) are not well encoded.
For example:
A filename in the database is called "Aufsätze.docx". After storing this file with this filename in the zippackage and save the file on my hard disk, the filename is called "Aufs+ñtze.docx".
I've tried a lot with encoding ... default, utf8, etc. but nothing works.
Do you have an idea, what else I can do or try? If you need more information or code snippets, please let me know it.
Kind regards,
Chris
I've got a little problem with the ZipPackage in the Telerik.Windows.Zip library.
I'm developing in a Silverlight environment (Silverlight Business Application). On the server side I zip a user specified amount of files (which are stored in a Microsoft SQL database).
At first a little code snippet:
MemoryStream ms =
new
MemoryStream();
byte
[] zip =
null
;
using
( ZipPackage zipfile = ZipPackage.Create(ms) ) {
foreach
( var kvp
in
files ) {
zipfile.AddStream(
new
MemoryStream(kvp.Value), kvp.Key, ZipCompression.Default, DateTime.Now);
}
zip =
new
byte
[(
int
) ms.Length];
ms.Seek(0, SeekOrigin.Begin);
ms.Read(zip, 0, (
int
) ms.Length);
ms.Dispose();
}
return
zip;
As you can see, I store the ZipPackage in a MemoryStream. After the "using" code block I return the content of the MemoryStream (ms) back to the client side of my application (the above procedure is called due to an InvokeOperation). On the client side, the returned byte array will be stored under a user specified filename in the local file system. This works really proper, but after opening the stored zip file, I see, that filenames (containing german umlauts like ä, ö, ü) are not well encoded.
For example:
A filename in the database is called "Aufsätze.docx". After storing this file with this filename in the zippackage and save the file on my hard disk, the filename is called "Aufs+ñtze.docx".
I've tried a lot with encoding ... default, utf8, etc. but nothing works.
Do you have an idea, what else I can do or try? If you need more information or code snippets, please let me know it.
Kind regards,
Chris