I'm using an HttpHandler on a remote server to listen to requests for .abc files. When it gets a request, it checks the Request.Files["filename"] to see if there is a file, and, if so, saves the file locally. I'm using the HttpWebRequest to instantiate the
request and write a file to the request stream by instantiating the WebRequest.Create("http://removeserver") call. I know how to write string values (by encoding them), but how do i write a file out to the request stream so that the handler can pick it up?
Any thoughts?
No, I've already implemented the upload part for the site. That all works fine. A new spec has come in for the application to the effect that after the file is uploaded to the server, a copy is made, and then needs to be sent off to a remote server. So i set
up the HttpHandler on the remote server to listen for specific file requests of extension .abc (abritrary), and on the client side, created a WebRequest pointing to a test.abc file on that remote server, and write the recently uploaded file to the request
stream to be picked up by the HttpHandler. I know how to write simple form values, but cannot figure out how to add a file to the request stream to be picked up by the Request.Files["filename"] collection on the remote server.
Correction. You the man. That is it, i skimmed it and thought it was just another "how to upload a file" tutorial. I've never heard of the WebClient class, but i like it. Thanks :)
chapel21
Contributor
2485 Points
499 Posts
HttpHandler and HttpWebRequest
Feb 26, 2004 07:43 PM|LINK
MilanNegovan
Participant
1421 Points
296 Posts
MVP
Re: HttpHandler and HttpWebRequest
Feb 26, 2004 08:34 PM|LINK
http://www.AspNetResources.com
ASP.NET With Emphasis On Web Standards
chapel21
Contributor
2485 Points
499 Posts
Re: HttpHandler and HttpWebRequest
Feb 26, 2004 09:19 PM|LINK
chapel21
Contributor
2485 Points
499 Posts
Re: HttpHandler and HttpWebRequest
Feb 26, 2004 09:27 PM|LINK