473,320 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

WebBrowserControl and csv files

If I navigate to say http://Site/filename.csv, the web browser control
or IE displays an excel sheet with the data in it. (Safari displays the
raw text).

This is not what I want. I want to get hold of the data and crunch it.
How do I do this ? (or alternatively download the csv file which is
pointed to by a hyperlink).

Thanks.
Dec 5 '07 #1
4 2240
Ian,

You would have to add a content-disposition header on the server,
indicating that it is an attachment, along with the filename. You can do it
in ASP.NET like this:

Response.AppendHeader("Content-disposition", "attachment; filename=my.csv");
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Ian Semmel" <an****@rocketcomp.com.auwrote in message
news:5309892ED0E548C0A9416C12BB48C21A@DIMITY...
If I navigate to say http://Site/filename.csv, the web browser control or IE
displays an excel sheet with the data in it. (Safari displays the raw text).

This is not what I want. I want to get hold of the data and crunch it. How
do I do this ? (or alternatively download the csv file which is pointed to
by a hyperlink).

Thanks.

Dec 6 '07 #2
Unfortunately it's not my server. It's a public download site and I just
wanted to automate it.

Basically, I want to get hold of the file (or text) which the WebBrowser
has downloaded before it displays it.
-----Original Message-----
From: Nicholas Paldino [.NET/C# MVP]
[mailto:mv*@spam.guard.caspershouse.com]
Posted At: Thursday, 6 December 2007 11:56 AM
Posted To: microsoft.public.dotnet.languages.csharp
Conversation: WebBrowserControl and csv files
Subject: Re: WebBrowserControl and csv files

Ian,

You would have to add a content-disposition header on the server,
indicating that it is an attachment, along with the filename. You can
do it
in ASP.NET like this:

Response.AppendHeader("Content-disposition", "attachment;
filename=my.csv");
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Ian Semmel" <an****@rocketcomp.com.auwrote in message
news:5309892ED0E548C0A9416C12BB48C21A@DIMITY...
If I navigate to say http://Site/filename.csv, the web browser control
or IE
displays an excel sheet with the data in it. (Safari displays the raw
text).

This is not what I want. I want to get hold of the data and crunch it.
How
do I do this ? (or alternatively download the csv file which is
pointed
to
by a hyperlink).

Thanks.
Dec 6 '07 #3
Ian,

Well, you could use the HttpWebRequest/HttpWebResponse classes to
download the content directly from the server out-of-band of the WebBrowser.
Perhaps this will give you what you want?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ian Semmel" <an****@rocketcomp.com.auwrote in message
news:B302BF493AA5408BB642E99A5548E2E3@DIMITY...
Unfortunately it's not my server. It's a public download site and I just
wanted to automate it.

Basically, I want to get hold of the file (or text) which the WebBrowser
has downloaded before it displays it.
>-----Original Message-----
From: Nicholas Paldino [.NET/C# MVP]
[mailto:mv*@spam.guard.caspershouse.com]
Posted At: Thursday, 6 December 2007 11:56 AM
Posted To: microsoft.public.dotnet.languages.csharp
Conversation: WebBrowserControl and csv files
Subject: Re: WebBrowserControl and csv files

Ian,

You would have to add a content-disposition header on the server,
indicating that it is an attachment, along with the filename. You can
do it
in ASP.NET like this:

Response.AppendHeader("Content-disposition", "attachment;
filename=my.csv");
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Ian Semmel" <an****@rocketcomp.com.auwrote in message
news:5309892ED0E548C0A9416C12BB48C21A@DIMITY...
If I navigate to say http://Site/filename.csv, the web browser control
or IE
displays an excel sheet with the data in it. (Safari displays the raw
text).

This is not what I want. I want to get hold of the data and crunch it.
How
do I do this ? (or alternatively download the csv file which is
pointed
>to
by a hyperlink).

Thanks.
Dec 6 '07 #4
Perfect ! Thanks
-----Original Message-----
From: Nicholas Paldino [.NET/C# MVP]
[mailto:mv*@spam.guard.caspershouse.com]
Posted At: Thursday, 6 December 2007 2:22 PM
Posted To: microsoft.public.dotnet.languages.csharp
Conversation: WebBrowserControl and csv files
Subject: Re: WebBrowserControl and csv files

Ian,

Well, you could use the HttpWebRequest/HttpWebResponse classes to
download the content directly from the server out-of-band of the
WebBrowser.
Perhaps this will give you what you want?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ian Semmel" <an****@rocketcomp.com.auwrote in message
news:B302BF493AA5408BB642E99A5548E2E3@DIMITY...
Unfortunately it's not my server. It's a public download site and I
just
wanted to automate it.

Basically, I want to get hold of the file (or text) which the
WebBrowser
has downloaded before it displays it.
-----Original Message-----
From: Nicholas Paldino [.NET/C# MVP]
[mailto:mv*@spam.guard.caspershouse.com]
Posted At: Thursday, 6 December 2007 11:56 AM
Posted To: microsoft.public.dotnet.languages.csharp
Conversation: WebBrowserControl and csv files
Subject: Re: WebBrowserControl and csv files

Ian,

You would have to add a content-disposition header on the
server,
indicating that it is an attachment, along with the filename. You
can
do it
in ASP.NET like this:

Response.AppendHeader("Content-disposition", "attachment;
filename=my.csv");
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Ian Semmel" <an****@rocketcomp.com.auwrote in message
news:5309892ED0E548C0A9416C12BB48C21A@DIMITY...
If I navigate to say http://Site/filename.csv, the web browser
control
or IE
displays an excel sheet with the data in it. (Safari displays the
raw
text).

This is not what I want. I want to get hold of the data and crunch
it.
How
do I do this ? (or alternatively download the csv file which is
pointed
to
by a hyperlink).

Thanks.
Dec 6 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
44
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
18
by: JKop | last post by:
Here's what I know so far: You have a C++ project. You have source files in it. When you go to compile it, first thing the preprocessor sticks the header files into each source file. So now...
3
by: pooja | last post by:
Suppose i have created a class c1 with f1()in c1.cpp and included this c1.cpp in file1.cpp file , which is also having main() by giving the statement #include "c1.cpp". the same i can do by...
11
by: ambika | last post by:
Iam just trying to know "c". And I have a small doubt about these header files. The header files just contain the declaration part...Where is the definition for these declarations written??And how...
4
by: Tobias Winter | last post by:
Hi I want to know how I can retrieve the 'onchange'-Event of an HTML-Input-Element in my vb.net-code? I have access to the documentproperty (DOM) of the Webbrowsercontrol Thx Tobias
18
by: UJ | last post by:
Folks, We provide custom content for our customers. Currently we put the files on our server and people have a program we provide that will download the files. These files are usually SWF, HTML or...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.