Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Uploading Files


Message #1 by "Garland Frye" <gfrye@s...> on Mon, 4 Mar 2002 17:26:23 -0600
I'm trying to upload a file in asp.net with the HtmlInputFile control. The

file uploads and saves on the server... The only problem is it's

HtmlInputFile.PostedFile.ContentLength property = 0...

The code that uploads the file is taken directly from the MSDN help files...

Anyone have any suggestions?



Thanks in advance,

Garland R. Frye





Message #2 by "Klaus Hellmich" <Klaus@H...> on Tue, 12 Mar 2002 08:34:48
Hi Garland 



Be sure that your form has enctype="multipart/form-data", otherwise it 

does not send the file or the server can not recognize it.



For debugging there is something helpful to see, what comes up to the 

server together with the posted request:

Page.Request.SaveAs("c:\\temp\\completeRequest.txt",true);

There should be your file inside somewhere.



Klaus





> I'm trying to upload a file in asp.net with the HtmlInputFile control. 

The

> file uploads and saves on the server... The only problem is it's

> HtmlInputFile.PostedFile.ContentLength property = 0...

> The code that uploads the file is taken directly from the MSDN help 

files...

> Anyone have any suggestions?

> 

> Thanks in advance,

> Garland R. Frye

> 

> 


  Return to Index