Results 1 to 4 of 4

Thread: Save and Open the Uploaded file ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Posts
    11

    Save and Open the Uploaded file ?

    Hi all,
    I have an ASP.NET project using VB.NET.
    My application will allow user to upload multiple attachments.(any type of files)
    All the uploaded files will be store in the server(folder) for futher retriving.
    Later, user can open the download file by clicking a hyperlink from a page.
    Anyone have any idea and advice on how to do this ?
    Any tutorial or samples that I can refer to ?
    How can I Save and Open a file to and from a folder?
    Thanks.

    Regards,
    Hean

  2. #2
    Registered User
    Join Date
    Jul 2002
    Posts
    80
    Here's some code that might help.



    <asp:label id="Label1" runat="server">Select a file to upload: </asp:label><input id="uploadedFile" type="file" name="uploadedFile" runat="server">



    Code Behind:
    Imports System.IO

    strFileName = uploadedFile.PostedFile.FileName
    Dim myFileName As String = System.IO.Path.GetFileName(strFileName)

    uploadedFile.PostedFile.SaveAs("c:\inetpub\wwwroot\foldername\filename\")

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2001
    Posts
    11
    Thanks.
    But it only for Save file.
    I still look for how to Open the file....

  4. #4
    Hyperactive Member ARPRINCE's Avatar
    Join Date
    Mar 2003
    Location
    Pinoy in NJ
    Posts
    381
    Originally posted by jl39775
    Here's some code that might help.

    <asp:label id="Label1" runat="server">Select a file to upload: </asp:label><input id="uploadedFile" type="file" name="uploadedFile" runat="server">

    Code Behind:
    Imports System.IO

    strFileName = uploadedFile.PostedFile.FileName
    Dim myFileName As String = System.IO.Path.GetFileName(strFileName)

    uploadedFile.PostedFile.SaveAs("c:\inetpub\wwwroot\foldername\filename\")
    Thanks for this code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width