3 Answers, 1 is accepted
0
Hi Tracey,
I attached a sample solution demonstrating a possible approach towards your scenario. Please give it a try and let me know if it works for you.
Regards,
Tina Stancheva
the Telerik team
I attached a sample solution demonstrating a possible approach towards your scenario. Please give it a try and let me know if it works for you.
Regards,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Tracey
Top achievements
Rank 1
answered on 17 Nov 2011, 06:28 PM
Hi Tina
Using a RadUploadHandler (almost) works a treat. I have some xml files in the folder I am unzipping and it doesn't create them correctly, it adds a lot more data to the files (as if it's writing the entire folder contents to the file - see jpg in link Unzipped Xml File).
from what I tested the rest - folders, .mp3, .mp4, .jpg, .png all unzipped correctly
Cheers
Using a RadUploadHandler (almost) works a treat. I have some xml files in the folder I am unzipping and it doesn't create them correctly, it adds a lot more data to the files (as if it's writing the entire folder contents to the file - see jpg in link Unzipped Xml File).
from what I tested the rest - folders, .mp3, .mp4, .jpg, .png all unzipped correctly
Cheers
0
Hello Tracey,
I can't reproduce this issue on our side. Can you reproduce it using the sample solution attached here? If you can, then the cause might be in the content of the archives you upload and/or the content of the xml files that have to be extracted on the server.
This is why I wanted to ask you to please send us a support ticket and attach the zip file that you use to reproduce the issue on our side. This way we will be able to test it here as well.
Also, you can try modifying the SaveFile() method:
to see if the issue is still reproducible.
Thank you in advance for your cooperation on the matter.
Best wishes,
Tina Stancheva
the Telerik team
I can't reproduce this issue on our side. Can you reproduce it using the sample solution attached here? If you can, then the cause might be in the content of the archives you upload and/or the content of the xml files that have to be extracted on the server.
This is why I wanted to ask you to please send us a support ticket and attach the zip file that you use to reproduce the issue on our side. This way we will be able to test it here as well.
Also, you can try modifying the SaveFile() method:
//Save the unzipped files
private
static
void
SaveFile(ZipPackageEntry entry,
string
destinationPath)
{
Stream stream = entry.OpenInputStream();
var fileName = destinationPath +
"\\"
+ entry.FileNameInZip;
var directoryName = Path.GetDirectoryName(fileName);
if
(directoryName !=
null
)
{
if
(!Directory.Exists(directoryName))
{
Directory.CreateDirectory(directoryName);
}
StreamReader reader =
new
StreamReader(stream);
string
text = reader.ReadToEnd();
File.WriteAllText(fileName, text);
}
}
Thank you in advance for your cooperation on the matter.
Best wishes,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>