473,243 Members | 1,443 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,243 software developers and data experts.

Client code for accessing file in an HttpResponse stream?

I am trying to save a file dynamically created in a webpage. I get the
following headers, but cannot figure out how to save the attachment. I am
basically trying to replicate what internet explorer would do in this case.

The headers I am getting are:

Headers {Content-Disposition: attachment; filename="dynamic_file.mdb"
Connection: close
Cache-Control: private
Content-Type: application/octet-stream
Date: Tue, 06 Sep 2005 16:04:41 GMT
Expires: Thu, 06 Oct 2005 16:04:42 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
}

How do I save dynamic_file.mdb?

Thanks,

- Daniel
Nov 19 '05 #1
5 3019
Do you mean you are trying to create a valid MDB file manually, from code,
and not trying to "send" one that's already created (at the server file
level) to the client?

If so then its not that easy. Some files are text based, and therefore
easily created, or have simple interpreters/converters (like excel) but
creating an MDB from nothing but text will require some sort of compiler I
would suspect. I think you are going to have to hit up an Access group and
ask them about that specifically though, if I understand your request right.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Daniel Corbett" wrote:
The question is how do I try. I have found 0 code examples for this case.
There are lots of code examples which explain how to use WebClient to
download a static file given a URL to the file.

What I tried to do is to open the stream on the Response, and write that to
a file.
The file is an Access file and wasn't recognized by Access as being a valid
access file. Perhaps there is something else I need to do. Are the
headers included in that stream? How far do I have to go to skip them?

"Curt_C [MVP]" wrote:
What happened when you tried? Was there an error? Streaming a file to the
client is easily searchable but I wasnt sure if there was a specific aspect
that was causing the issue...??

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Daniel Corbett" wrote:
I am trying to save a file dynamically created in a webpage. I get the
following headers, but cannot figure out how to save the attachment. I am
basically trying to replicate what internet explorer would do in this case.

The headers I am getting are:

Headers {Content-Disposition: attachment; filename="dynamic_file.mdb"
Connection: close
Cache-Control: private
Content-Type: application/octet-stream
Date: Tue, 06 Sep 2005 16:04:41 GMT
Expires: Thu, 06 Oct 2005 16:04:42 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
}

How do I save dynamic_file.mdb?

Thanks,

- Daniel

Nov 19 '05 #2
The question is how do I try. I have found 0 code examples for this case.
There are lots of code examples which explain how to use WebClient to
download a static file given a URL to the file.

What I tried to do is to open the stream on the Response, and write that to
a file.
The file is an Access file and wasn't recognized by Access as being a valid
access file. Perhaps there is something else I need to do. Are the
headers included in that stream? How far do I have to go to skip them?

"Curt_C [MVP]" wrote:
What happened when you tried? Was there an error? Streaming a file to the
client is easily searchable but I wasnt sure if there was a specific aspect
that was causing the issue...??

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Daniel Corbett" wrote:
I am trying to save a file dynamically created in a webpage. I get the
following headers, but cannot figure out how to save the attachment. I am
basically trying to replicate what internet explorer would do in this case.

The headers I am getting are:

Headers {Content-Disposition: attachment; filename="dynamic_file.mdb"
Connection: close
Cache-Control: private
Content-Type: application/octet-stream
Date: Tue, 06 Sep 2005 16:04:41 GMT
Expires: Thu, 06 Oct 2005 16:04:42 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
}

How do I save dynamic_file.mdb?

Thanks,

- Daniel

Nov 19 '05 #3
What happened when you tried? Was there an error? Streaming a file to the
client is easily searchable but I wasnt sure if there was a specific aspect
that was causing the issue...??

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Daniel Corbett" wrote:
I am trying to save a file dynamically created in a webpage. I get the
following headers, but cannot figure out how to save the attachment. I am
basically trying to replicate what internet explorer would do in this case.

The headers I am getting are:

Headers {Content-Disposition: attachment; filename="dynamic_file.mdb"
Connection: close
Cache-Control: private
Content-Type: application/octet-stream
Date: Tue, 06 Sep 2005 16:04:41 GMT
Expires: Thu, 06 Oct 2005 16:04:42 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
}

How do I save dynamic_file.mdb?

Thanks,

- Daniel

Nov 19 '05 #4
Hi Daniel,

AS for the accessing the download file stream from httresponse. Here is
some of my understanding:

1. Is the remote web page direclty write down a file into the response
stream?

2. Are you using HttpWebRequest or any other component to request the file
downloading page?

As far as I know, if you're using HttpWebRequest, we can use the
HttpWebResponse.GetResponseStream() method to get the binary stream in the
http response message. Then, we can save the stream to a file on the hard
disk.

Please feel free to let me know if the above is the scenario you met. IF
there're any other concerns, please post here also. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Client code for accessing file in an HttpResponse stream?
| thread-index: AcWzQfAo9nX0QueATNCtj82+W+VrIA==
| X-WBNR-Posting-Host: 12.148.198.43
| From: =?Utf-8?B?Q3VydF9DIFtNVlBd?= <software_at_darkfalz.com>
| References: <6B**********************************@microsoft.co m>
<B9**********************************@microsoft.co m>
<40**********************************@microsoft.co m>
| Subject: RE: Client code for accessing file in an HttpResponse stream?
| Date: Tue, 6 Sep 2005 17:20:23 -0700
| Lines: 66
| Message-ID: <C5**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:122749
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Do you mean you are trying to create a valid MDB file manually, from
code,
| and not trying to "send" one that's already created (at the server file
| level) to the client?
|
| If so then its not that easy. Some files are text based, and therefore
| easily created, or have simple interpreters/converters (like excel) but
| creating an MDB from nothing but text will require some sort of compiler
I
| would suspect. I think you are going to have to hit up an Access group
and
| ask them about that specifically though, if I understand your request
right.
|
|
| --
| Curt Christianson
| site: http://www.darkfalz.com
| blog: http://blog.darkfalz.com
|
|
|
| "Daniel Corbett" wrote:
|
| > The question is how do I try. I have found 0 code examples for this
case.
| > There are lots of code examples which explain how to use WebClient to
| > download a static file given a URL to the file.
| >
| > What I tried to do is to open the stream on the Response, and write
that to
| > a file.
| > The file is an Access file and wasn't recognized by Access as being a
valid
| > access file. Perhaps there is something else I need to do. Are the
| > headers included in that stream? How far do I have to go to skip them?
| >
| > "Curt_C [MVP]" wrote:
| >
| > > What happened when you tried? Was there an error? Streaming a file to
the
| > > client is easily searchable but I wasnt sure if there was a specific
aspect
| > > that was causing the issue...??
| > >
| > > --
| > > Curt Christianson
| > > site: http://www.darkfalz.com
| > > blog: http://blog.darkfalz.com
| > >
| > >
| > >
| > > "Daniel Corbett" wrote:
| > >
| > > > I am trying to save a file dynamically created in a webpage. I
get the
| > > > following headers, but cannot figure out how to save the
attachment. I am
| > > > basically trying to replicate what internet explorer would do in
this case.
| > > >
| > > > The headers I am getting are:
| > > >
| > > > Headers {Content-Disposition: attachment;
filename="dynamic_file.mdb"
| > > > Connection: close
| > > > Cache-Control: private
| > > > Content-Type: application/octet-stream
| > > > Date: Tue, 06 Sep 2005 16:04:41 GMT
| > > > Expires: Thu, 06 Oct 2005 16:04:42 GMT
| > > > Server: Microsoft-IIS/6.0
| > > > X-Powered-By: ASP.NET
| > > > }
| > > >
| > > > How do I save dynamic_file.mdb?
| > > >
| > > > Thanks,
| > > >
| > > > - Daniel
|

Nov 19 '05 #5
Hi Daniel,

Have you got any further progress on this issue or does the suggestions in
my last reply helps a little? If there're any other things we can help,
please feel free to post here.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 144873056
| References: <6B**********************************@microsoft.co m>
<B9**********************************@microsoft.co m>
<40**********************************@microsoft.co m>
<C5**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online.microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Wed, 07 Sep 2005 05:54:49 GMT
| Subject: RE: Client code for accessing file in an HttpResponse stream?
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <pE**************@TK2MSFTNGXA01.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 115
| Path: TK2MSFTNGXA01.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:122794
| NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
|
| Hi Daniel,
|
| AS for the accessing the download file stream from httresponse. Here is
| some of my understanding:
|
| 1. Is the remote web page direclty write down a file into the response
| stream?
|
| 2. Are you using HttpWebRequest or any other component to request the
file
| downloading page?
|
| As far as I know, if you're using HttpWebRequest, we can use the
| HttpWebResponse.GetResponseStream() method to get the binary stream in
the
| http response message. Then, we can save the stream to a file on the hard
| disk.
|
| Please feel free to let me know if the above is the scenario you met. IF
| there're any other concerns, please post here also. Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
| --------------------
| | Thread-Topic: Client code for accessing file in an HttpResponse stream?
| | thread-index: AcWzQfAo9nX0QueATNCtj82+W+VrIA==
| | X-WBNR-Posting-Host: 12.148.198.43
| | From: =?Utf-8?B?Q3VydF9DIFtNVlBd?= <software_at_darkfalz.com>
| | References: <6B**********************************@microsoft.co m>
| <B9**********************************@microsoft.co m>
| <40**********************************@microsoft.co m>
| | Subject: RE: Client code for accessing file in an HttpResponse stream?
| | Date: Tue, 6 Sep 2005 17:20:23 -0700
| | Lines: 66
| | Message-ID: <C5**********************************@microsoft.co m>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | Xref: TK2MSFTNGXA01.phx.gbl
| microsoft.public.dotnet.framework.aspnet:122749
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | Do you mean you are trying to create a valid MDB file manually, from
| code,
| | and not trying to "send" one that's already created (at the server file
| | level) to the client?
| |
| | If so then its not that easy. Some files are text based, and therefore
| | easily created, or have simple interpreters/converters (like excel) but
| | creating an MDB from nothing but text will require some sort of
compiler
| I
| | would suspect. I think you are going to have to hit up an Access group
| and
| | ask them about that specifically though, if I understand your request
| right.
| |
| |
| | --
| | Curt Christianson
| | site: http://www.darkfalz.com
| | blog: http://blog.darkfalz.com
| |
| |
| |
| | "Daniel Corbett" wrote:
| |
| | > The question is how do I try. I have found 0 code examples for this
| case.
| | > There are lots of code examples which explain how to use WebClient to
| | > download a static file given a URL to the file.
| | >
| | > What I tried to do is to open the stream on the Response, and write
| that to
| | > a file.
| | > The file is an Access file and wasn't recognized by Access as being a
| valid
| | > access file. Perhaps there is something else I need to do. Are
the
| | > headers included in that stream? How far do I have to go to skip
them?
| | >
| | > "Curt_C [MVP]" wrote:
| | >
| | > > What happened when you tried? Was there an error? Streaming a file
to
| the
| | > > client is easily searchable but I wasnt sure if there was a
specific
| aspect
| | > > that was causing the issue...??
| | > >
| | > > --
| | > > Curt Christianson
| | > > site: http://www.darkfalz.com
| | > > blog: http://blog.darkfalz.com
| | > >
| | > >
| | > >
| | > > "Daniel Corbett" wrote:
| | > >
| | > > > I am trying to save a file dynamically created in a webpage. I
| get the
| | > > > following headers, but cannot figure out how to save the
| attachment. I am
| | > > > basically trying to replicate what internet explorer would do in
| this case.
| | > > >
| | > > > The headers I am getting are:
| | > > >
| | > > > Headers {Content-Disposition: attachment;
| filename="dynamic_file.mdb"
| | > > > Connection: close
| | > > > Cache-Control: private
| | > > > Content-Type: application/octet-stream
| | > > > Date: Tue, 06 Sep 2005 16:04:41 GMT
| | > > > Expires: Thu, 06 Oct 2005 16:04:42 GMT
| | > > > Server: Microsoft-IIS/6.0
| | > > > X-Powered-By: ASP.NET
| | > > > }
| | > > >
| | > > > How do I save dynamic_file.mdb?
| | > > >
| | > > > Thanks,
| | > > >
| | > > > - Daniel
| |
|
|

Nov 19 '05 #6

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

Similar topics

2
by: Sleepy | last post by:
I am wanting to allow a client to download a file from a web server and save it on their local PC. The only way that I have found to do this is to use HTTP headers. I am using the code shown below...
3
by: Steven Thomas | last post by:
I am working on a ASP.NET application using VB.NET. I have a function that creates a snapshot file on a separate server and passes a path back to the webpage. Now I want to display the snapshot. ...
8
by: david | last post by:
I have made a test: copy a text file to clinet side. But fails. What I did is that create a web method in web services that read a text in server side and return the text file as string. On the...
3
by: Fredrik | last post by:
I want to generate a pdf file of "the current page". It is a ASP.NET aspx file created partly from GET parameters, but most often using the ASP.NET event model (i.e. clicking buttons etc). One...
8
by: ad | last post by:
How can I download a file form Server to client?
11
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or...
1
by: Nathaniel | last post by:
A few stings ago I asked: I play an online game application that displays how many points I have earned. I want the number of points I have earned to appear as a string in a text box in the...
12
by: =?Utf-8?B?RnJlZU5FYXN5?= | last post by:
Hello, the scenario: There's an ASPX page which shows some text and has three buttons at the bottom: Save, Print and Close. Print and close is done by javascript. But how can I save the page...
4
by: Barbiturico76 | last post by:
Hi again, another question for you. In C# WinForms I used to create html and visualizing it in a IE wrapper, without even create a file on the system. It was very useful. Is there a way to...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
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...

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.