Hello Everyone, my name is Rosi and I am a developer on the ASP.NET navigation controls team.
This is my first blog post and I will be talking about the RadUpload component. Many customers have asked how to upload multiple files with it.
Unfortunately RadUpload does not yet support this functionality out of the box, but I will show you how to work-around this limitation. The trick is uploading one .zip file and extracting it on the server. To achieve this we will need a little help from a third party library. Such libraries are DotNetZip and SharpZipLib which provide a convenient API to manipulate .zip files. For the purposes of this blog post I will use DotNetZip.
When the file is uploaded on the server you will need to extract its contents. This is straightforward and can be done like this:
using (ZipFile zip = ZipFile.Read(targetFileName))
foreach (ZipEntry e in zip)
e.Extract(targetFolder, true); // overwrite == true
(Here you can find examples illustrating how to use it.)
Once finished you may delete the zip file if you wish. And that’s it – you’re done! The source code for the whole project is available here as a code library. Let me know if you find this blog post useful and feel free to leave a comment.
Iana Tsolova is Product Manager at Telerik’s DevTools division. She joined the company back in the beginning of 2008 as a Support Officer and has since occupied various positions at Telerik, including Senior Support Officer, Team Lead at one of the ASP.NET AJAX teams and Technical Support Director. Iana’s main interests are web development, reading articles related to geography, wild nature and latest renewable energy technologies.
Subscribe to be the first to get our expert-written articles and tutorials for developers!