browse local disk drive

Discussion in 'ASP .Net Building Controls' started by Stanley J Mroczek, Oct 20, 2004.

  1. I am looking to browse local disk drive to upload pictures to my web system.
    How do i display my local files? I am using an aspx in vb
     
    Stanley J Mroczek, Oct 20, 2004
    #1
    1. Advertising

  2. Stanley J Mroczek

    Jorge Matos Guest

    You can't programmatically browse local client files. You can use the HTML
    input element to allow the user to browse for files.

    <input type="file">

    "Stanley J Mroczek" wrote:

    > I am looking to browse local disk drive to upload pictures to my web system.
    > How do i display my local files? I am using an aspx in vb
     
    Jorge Matos, Oct 21, 2004
    #2
    1. Advertising

  3. use a file field html control


    "Stanley J Mroczek" <> wrote in message news:<>...
    > I am looking to browse local disk drive to upload pictures to my web system.
    > How do i display my local files? I am using an aspx in vb
     
    Wessam Zeidan, Oct 22, 2004
    #3
  4. Stanley J Mroczek

    Jorge Matos Guest

    You could use the HTML File field control but you don't necessarily have to -
    you DO need to make sure the <FORM> elements enctype attribute is set to
    "multipart/form-data" see html below:

    HTML:
    <form id="Form1" method="post" runat="server" enctype="multipart/form-data">
    <INPUT type="file">
    <INPUT type="submit" value="Post file">
    </form>

    CODE-BEHIND:
    private void Page_Load(object sender, System.EventArgs e)
    {
    if (this.IsPostBack)
    {
    if (this.Request.Files.Count > 0)
    {
    HttpPostedFile postedFile = this.Request.Files[0];
    postedFile.SaveAs(Server.MapPath("."),
    System.IO.Path.GetFileName(postedFile.FileName)));
    }
    }
    }


    "Wessam Zeidan" wrote:

    > use a file field html control
    >
    >
    > "Stanley J Mroczek" <> wrote in message news:<>...
    > > I am looking to browse local disk drive to upload pictures to my web system.
    > > How do i display my local files? I am using an aspx in vb

    >
     
    Jorge Matos, Oct 22, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon
    Replies:
    5
    Views:
    11,357
    Scott M.
    Jan 17, 2010
  2. Jas Shultz
    Replies:
    0
    Views:
    991
    Jas Shultz
    Dec 3, 2003
  3. shailesh
    Replies:
    1
    Views:
    849
    Tim Golden
    Mar 28, 2007
  4. wenfu cho
    Replies:
    2
    Views:
    243
    wenfu cho
    Jun 28, 2004
  5. Replies:
    0
    Views:
    244
Loading...

Share This Page