Click to See Complete Forum and Search --> : upload files; HtmlInputFile


gabrielgv
05-24-2006, 08:31 PM
Hi

I'm creating a html to upload a file and an asp.net to get that file
In the html I'm chossing a file through an input of type file and sending by clicking the submit button but asp.net is not

getting the file

this is the code of html file
---------------------------------------------------
<html>
<head>
<title></title>
</head>

<body>
<form action="recibeArchivo.aspx" method="post" enctype="multipart/form-data" name="form1">
send a file
<input type="file" name="adjunto">
<br>
<input type="submit" name="Submit" value="Send">
</p>
</form>
</body>
</html>

---------------------------------------------------

this is the code of the asp.net called "recibeArchivo.aspx"
---------------------------------------------------
<%@ Page Language="VB" Debug="true"%>
<%@ Import Namespace="System.Web.UI.HtmlControls "%>
<html>
<head>
<title></title>
</head>
<body>
<%
Dim archivoRec As HtmlInputFile
archivoRec=New HtmlInputFile()
If IsNothing(archivoRec.PostedFile) Then

%>
there is NO file '''''''''''is not getting the file
<%
Else
%>
there is a file!!
<%
End If
%>
</body>
</html>
---------------------------------------------------
"recibeArchivo.aspx" displays this
--------------------------------------------------

there is NO file
--------------------------------------------------

what wold be wrong?
what can I do?

Thanks!