Accessing the PostedFile object of a multipart/form-data post

  • Thread starter Thread starter Abe Simpson
  • Start date Start date
A

Abe Simpson

Hi all.

I am using a 3rd party ActiveX control to upload files to the web server
using the multipart/form-data format (described in RFC 1867). In regular
ASP, I have to use another 3rd party component, such as AspUpload, to
capture the files. In .NET, we have PostedFile, but I can' figure out how to
use it in this scenario.

There are no <INPUT TYPE="FILE" RUNAT="Server"> items to work with, nor are
there any <form>'s. All I have is a multipart/form-data stream, and the file
items are named FILE001, FILE002, etc. (there can be more than one). If I
handle this post from a Page_Load( Object sender, EventArgs e) function, how
to do I get those file items to be represented by PostedFile objects?

Thanks in advance.

-- Abe
 
look at the HttpRequest.Files collection.

note: asp.net loads the files into memory, so you may have to bump up the
workersize and maxrequestlength.

-- bruce (sqlwork.com)
 
Thanks Bruce, that worked great.

-- Abe


Bruce Barker said:
look at the HttpRequest.Files collection.

note: asp.net loads the files into memory, so you may have to bump up the
workersize and maxrequestlength.

-- bruce (sqlwork.com)
 
Back
Top