locked
Dotnetzip - download media files from CDN RRS feed

All replies

  • User541108374 posted

    Hi,

    you can run a proces on your web server that downloads the files/images from the CDN, bundles them up in a zip and exposes them to the browser.

    The initial request would start at the browser and calls a service (Web API or WCF/webservice or HttpHandler) which does the requests to the CDN.

    Kris.

    Wednesday, February 28, 2018 8:40 AM
  • User-51021203 posted

    Thank you very much kris.

    But in my case size of files are large around 300 MB, and it would be multiple files.

    So server need much CPU and memory. so won't use this solution.

    Is there any direct way from C# or javascript to handle this situation

    Wednesday, February 28, 2018 10:02 AM
  • User541108374 posted

    Hi,

    Is there any direct way from C# or javascript to handle this situation

    Not from JavaScript hence my proposal to do it via a service which you can call from JavaScript.

    You didn't mention the size of 300Mb. You could create a local running console application to do the task.

    Exactly what's the usage scenario? Do you want people to download a zip from CDN that you put there first yourself? If so then you could have a process (windows service, console application) that can bundle them in a zip and put them ready on CDN. This would be a separate process and you would make a page where people can select files that you have on your CDN, save their selection (likely in a database) and then the other process could read from the database or get a trigger that would package the files into a zip and put them on the CDN, then after a page refresh a link to the resulting CDN zip file would be presented.

    On Azure I would likely make use of CDN, Azure Functions, Event Grid and potentially Logic Apps to pull this together.

    Kris.

    Wednesday, February 28, 2018 1:16 PM
  • User-51021203 posted

    My requirement is, there are multiple thumb images will appear on page, and "Download All" button will appear beside thumb images.

    Once user click on "Dwonload All" button, a downloading process should be start on user machine.

    Ex. https://news.nike.com/news/nike-women-sneakers-unlaced (Click on Download)

    I can not keep predefined zip files as user may have different selection (there is checkbox near thumb, so only selected thumb images will get downloaded)

    Thursday, March 1, 2018 6:41 AM
  • User541108374 posted

    Hi,

    I can not keep predefined zip files as user may have different selection (there is checkbox near thumb, so only selected thumb images will get downloaded)

    Then make it as I made clear in my first reply. This requires a near zero time experience for your enduser.

    What you can do, is instead of downloading the images from the CDN keep them local together with your application so that you don't face the latency overhead of fetching images from the CDN which costs time and potentially money for egress if it's on public cloud or some vendors infrastructure for the bandwidth usage.

    Likely you have some central repository for your images from where you push to the CDN in an automated manner, you can have that same process push it to your webserver as well and use those images to zip up fast in the application and have it all in the same call from the browser returned to the enduser.

    Kris.

    Thursday, March 1, 2018 6:48 AM