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 8144177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:18:20+00:00 2026-06-06T13:18:20+00:00

I have been working on this application that enables user to log in into

  • 0

I have been working on this application that enables user to log in into another website, and then download specified file from that server. So far I have succeeded in logging on the website and download the file. But everything ruins when it comes to zip files.

Is there any chunk of code that could be helpful in reading the .zip files byte by byte or by using stream reader?

I m using downloadfile() but its not returning the correct zip file.

I need a method by which I can read zip files. Can I do it by using ByteReader()

The code used to download zip file is

string filename = "13572_BranchInformationReport_2012-05-22.zip";
            string filepath = "C:\\Documents and Settings\\user\\Desktop\\" + filename.ToString();
            WebClient client = new WebClient();
            string user = "abcd", pass = "password";
            client.Credentials = new NetworkCredential(user, pass);
            client.Encoding = System.Text.Encoding.UTF8;
            try
            {
                client.DownloadFile("https://web.site/archive/13572_BranchInformationReport_2012-05-22.zip", filepath);
                Response.Write("Success");
            }
            catch (Exception ue)
            {
                Response.Write(ue.Message);
            }

Thanks in advance.

  • 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-06T13:18:22+00:00Added an answer on June 6, 2026 at 1:18 pm

    Your answer

    WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
    objResponse = objRequest.GetResponse();
    byte[] buffer = new byte[32768];
    using (Stream input = objResponse.GetResponseStream())
    {
    using (FileStream output = new FileStream ("test.doc",
    FileMode.CreateNew))
    {
    int bytesRead;
    
    while ( (bytesRead=input.Read (buffer, 0, buffer.Length)) > 0)
    {
    output.Write(buffer, 0, bytesRead);
    }
    }
    } 
    

    This is how i achieved it. Thanks everyone for ur help

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

Sidebar

Related Questions

So I have been working on this phone gap application that uses jquery-mobile. Recently,
I've been working on this application but have come across a problem that I
So I am working on this application that deals with audio, and I have
Users have been able to log into my website using their Facebook account, but
I have been working on a java application that has a connection to a
I have been working on creating an application that sends a string from an
I have an application that has been working with session variables no problem. I
I have been working on a C# WinForms application that registers several hot keys
I have recently been working on a C# application that calls a webservice over
Have been working on this question for a couple hours and have come close

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.