so why is this not working ?
===== default.htm ===========
<form name="userForm" action="upload.aspx" ENCTYPE="multipart/form-data" method="post" runat="server" >
<input id="uploadedFile" type="file" >
<input type="submit" id="upload" value="Upload" >
</form>
===== upload.aspx ===========
<Script runat="server" >
Private Sub Page_Load()
SaveImages()
End Sub 'Page_Load
Private Function SaveImages() As System.Boolean
Dim _files As System.Web.HttpFileCollection = System.Web.HttpContext.Current.Request.Files
Dim _iFile As Integer
Dim _fileName, _fileExtension As System.String
Dim _message As New System.Text.StringBuilder("Files Uploaded:<br>" )
Try
For _iFile = 0 To _files.Count - 1
Dim _postedFile As System.Web.HttpPostedFile = _files(_iFile)
' file is a jpg or gif
'----------------------
_fileName = System.IO.Path.GetFileName(_postedFile.FileName)
_fileExtension = System.IO.Path.GetExtension(_fileName)
If _fileExtension = ".gif" or _fileExtension = ".jpg" Then
_postedFile.SaveAs((System.Web.HttpContext.Current .Request.MapPath("~/uploads/") & _fileName))
_message.Append((_fileName & "<BR>"))
Else
_message.Append((_fileName & " <font color=""red"">failed!! Only .gif and .jpg images allowed!</font<BR>"))
End If
Next _iFile
Label1.Text = _message.ToString()
Return True
Catch Ex As System.Exception
Label1.Text = Ex.Message
Return False
End Try
End Function 'SaveImages
</script>
<asp:label id="Label1" runat="server" />
"Kevin Spencer" <uc*@ftc.govwrote in message news:On**************@TK2MSFTNGP04.phx.gbl...
Certainly. An ASPX Page class is an HttpHandler, which means that it accepts Requests, and returns Responses. It doesn't have to
post only to itself, and it doesn't have to be posted to from itself, although that is more typical.
--
HTH,
Kevin Spencer
Microsoft MVP
Software Composer
A watched clock never boils.
"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot comwrote in message news:OH**************@TK2MSFTNGP05.phx.gbl...
>is it possible to submit a conventional html upload form to an ASPx file for processing ?