There are quite a few examples that show how to do this using a variety of third party zip libraries. That's mainly because there was nothing specifically designed for this in the.
NET framework until some new stuff was introduced in System. Compression in. NET 4. The simple examples that follow illustrates the use of the ZipFile.
In both cases, the user is presented with a list of checkboxes representing a selection of files to choose from. Submitting the form will result in just those files being packaged up into one zip file and downloaded. Can you help me about this? Saturday, March 21, AM. In its simplest version, the code would be just this: Response. End ; There are several variants and additional headers that you can use. Now that you know that you have to look for "Response.
WriteFile", it should be easy for you to find lots of examples across the 'net. You would place this code in the Click event handler for your "download" button. You can find something similar for your needs by just searching with Bing or Google.
You can also post to ASP. NET forums where you can be helped too. Generic; using System. IO; using System. TransmitFile Server. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. NET file download from server Ask Question. Asked 8 years, 2 months ago.
Active 1 year, 3 months ago. Viewed k times. Response; response. ClearContent ; response. Clear ; response.
MapPath "FileDownload. Flush ; response. End ;. Peter Mortensen James Stevenson James Stevenson 2 2 gold badges 6 6 silver badges 9 9 bronze badges. You can check this similar question: stackoverflow. End is causing the ThreadAbortException. This is a bug in the. Flush ; Response. The project download includes working examples of both of these techniques. View All. How to download a file in ASP. Andrew Fenster Updated date May 09, Net application:. The first step is to set the content type.
0コメント