Coffeehouse Post

Single Post Permalink

View Thread: My.Computer.Network.UploadFile
  • User profile image

    The Destination page, needs to deal with accepting the file, here's the code I used: 


    <%@ Import Namespace="System"%>
    <%@ Import Namespace="System.IO"%>
    <%@ Import Namespace="System.Net"%>
    <%@ Import NameSpace="System.Web"%>
    <Script language="VB" runat=server>
        Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
            Dim f As String
            Dim file
            For Each f In Request.Files.AllKeys
                file = Request.Files(f)
                file.SaveAs("c:\inetpub\test\UploadedFiles\" & file.FileName)
            Next f
        End Sub
    <p> Upload complete. </p>