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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:53:20+00:00 2026-05-19T10:53:20+00:00

In my website I am trying to download a CSV which comes from Yahoo.

  • 0

In my website I am trying to download a CSV which comes from Yahoo. It contains some data.

I am using the code given below to download CSV.

Problem:

I want to download and fetch all the data from Yahoo’s CSV but the whole CSV is not getting created on my side.

Only some portion of the data is copied. So CSV is not downloaded with all its data.

I tried increasing the Buffer size but that didn’t help

Data in Yahoo’s CSV is as shown in below screenshot. This is the data I want to download

alt text

Data that I get in created CSV, when I download the same Yahoo’s CSV is as shown below.

alt text

Code I am using to download the CSV from Yahoo

HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://download.finance.yahoo.com/d/quotes.csv?s=^DJI+^N225+^GSPC+^GDAXI+^FCHI+^HSI+^IXIC+^FTSE&f=l1d14n");
        HttpWebResponse ws = (HttpWebResponse)wr.GetResponse();
        Stream str = ws.GetResponseStream();
        inBuf = new Byte[10000000];
        int bytesToRead = Convert.ToInt32(inBuf.ToString().Length);

        int bytesRead=0;
        while(bytesToRead>0)
        {
            int n = str.Read(inBuf,bytesRead,bytesToRead);
            if(n==0)
            {
                break;
            }
            bytesRead += n;
            bytesToRead -= n;
        }
        FileStream fstr = new FileStream("C:\\VSS Working Folder\\20th Jan 11 NewHive\\NewHive\\CSV\\new.csv", FileMode.OpenOrCreate, FileAccess.Write);
        fstr.Write(inBuf,0,bytesRead);
        str.Close();
        fstr.Close();
        return "CSV Downloaded Successfully!";

What could be wrong?

  • 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-05-19T10:53:20+00:00Added an answer on May 19, 2026 at 10:53 am

    inBuf.ToString() gives you “System.Byte[]” and the length of that string is 13. So you are only saving 13 characters which will only give you 10274.52,"1/2 from the downloaded file.

    You can get the length using inBuf.Length. Note that Length returns an int so you don’t need to cast to an int.

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

Sidebar

Related Questions

I am trying to download a file from a website using the following code:
I am trying to download a file from a website using python and mechanize.
I'm trying to download some website's code to my app like this: public void
I'm trying to download data using commands below. import urllib url = 'http://www.nse-india.com/content/historical/EQUITIES/2002/MAR/cm01MAR2002bhav.csv.zip' urllib.urlretrieve(url,
I'm trying to download a favicon from a website using Node.js, but am having
Basically I'm trying to download images from a website using the following command (SwiftIRC
There is one IP (from China) which is trying to download my entire website.
I am using Ubuntu... I am trying to install racket from their website http://racket-lang.org/download/
I am trying to download the contents of a website using wget tool. I
I'm trying to download a website source code and display it in a textbox

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.