Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8512563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:18:45+00:00 2026-06-11T04:18:45+00:00

I have a Dot Net MVC server that stores some zip files. I’m able

  • 0

I have a Dot Net MVC server that stores some zip files. I’m able to download these zip files successfully if I click on the hyperlink. However if I try to download the zip file using WebClient’s DownloadFile, I’m able to download the zip file I get an error “Windows cannot open the folder, compressed zip folder is invalid”

Server side code :

public FilePathResult DownloadFile(int id)
{      
       string resultsdir = AppDomain.CurrentDomain.BaseDirectory + "Data\\ResultsDir\\" + res.RequestId.ToString();
       string downloadFile = System.IO.Path.GetFileName(res.DownloadPath);
       string zipPath = System.IO.Path.Combine(resultsdir, downloadFile);
       return File(zipPath, "application/zip", downloadFile);
}

Client side I’m using Webclient to download this file

WebClient wc = new WebClient();
wc.DownloadFile("http://servername/Results/DownloadFile/853", "localspkgfile.zip");

If I download file by clicking hyperlink on browser, the filesize is 2.9 mb. However using webclient the file size is 5kb. Looks like WebClient is not able to download the file properly. Can anyone please suggest me a way to download the file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:18:47+00:00Added an answer on June 11, 2026 at 4:18 am

    I don’t know what is wrong with your code, but that 5kb file you are downloading is almost certainly an HTML error page, which might contain information, such as a stacktrace, that will help you figure out what is going wrong. Change its extension to .html and open it in your browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dot net 4.0 DAL library project that contains three edmx files.
I have my dot files in Github publicly. This means that I have only
I have an iPad app that submits orders to an ASP.NET MVC web site
I have a dot net nuke 4 site with that has a forum. It
Does dot net 3.5 provides some api to calculate crc32 for input data?I have
I have a dot net nuke site that I have written a custom module
I have heard of remote dot net application. What I have understood that the
I have a dll that contains a dot net assembly - common intermediate language.
I have installed the dot net provider and tried to reference the FirebirdSql.Data.FirebirdClient.dll in
i have a doubt when we run the application (dot net application) dll or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.