Has anyone ever tried regrouping a list of image in a specific media folder for download?
Let say i have a news item where i will make use of a media picker to display the images in a slider and at same i can make those images downloadable. So instead of downloading the images a maximum of 5 low resolution images i will be able download all 5 images.
As Ravi suggests, the images can be zipped and made available for download. Umbraco already uses SharpZipLib ( http://www.nuget.org/packages/SharpZipLib/ ;), so that would be ideal to use, since the DLL already is in the bin folder.
Its only now i can have a look at this. As mentioned in my previous post the idea is to be able to down all images within a media Folder where there will be a maximum of 5 images all the time.
Here am using mediaPicker and displaying all 5 images, but not sure how to add create a zip file where all the 5 images will be downloable. So lets say the Media Folder in my media Section is "News Item 1" + 5 images in it, i would be able to download a zip file called "News Item.zip"
you should be able to use this as a starting point. this would cretae the zip and then you need to add your files to the zip in the zipfileList and then that would do most of the heavy lifting for you..
Regrouping a list of Images for Download
Has anyone ever tried regrouping a list of image in a specific media folder for download?
Let say i have a news item where i will make use of a media picker to display the images in a slider and at same i can make those images downloadable. So instead of downloading the images a maximum of 5 low resolution images i will be able download all 5 images.
Any idea how i might do this ?
//fuji
looking at references what you you would do the following
get the media ids for the files selected in your slider carousel.
create the paths using server map paths and the getfilename functions in umbraco
and then use a tool like SharpZipLib or dotnetzip http://dotnetzip.codeplex.com/ to createa package from the selected files on your webserver,
Then create the the zip as a new media item and then output that for user to download..
As Ravi suggests, the images can be zipped and made available for download. Umbraco already uses SharpZipLib ( http://www.nuget.org/packages/SharpZipLib/ ;), so that would be ideal to use, since the DLL already is in the bin folder.
I hadn't checked on Sharp Zip lib being included but there you go
Hi guys sorry i only have my mob with me at the moment but will give this a try. Thanks to both of you.
Its only now i can have a look at this. As mentioned in my previous post the idea is to be able to down all images within a media Folder where there will be a maximum of 5 images all the time.
Here am using mediaPicker and displaying all 5 images, but not sure how to add create a zip file where all the 5 images will be downloable. So lets say the Media Folder in my media Section is "News Item 1" + 5 images in it, i would be able to download a zip file called "News Item.zip"
Here is how am doing it but dont think this is the right. How do i get to use Sharp Zip here.
you should be able to use this as a starting point. this would cretae the zip and then you need to add your files to the zip in the zipfileList and then that would do most of the heavy lifting for you..
https://github.com/icsharpcode/SharpZipLib/wiki/Zip-Samples#wiki-anchorCreateIIS
is working on a reply...