Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > browse local disk drive

Reply
Thread Tools

browse local disk drive

 
 
Stanley J Mroczek
Guest
Posts: n/a
 
      10-19-2004
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
 
Reply With Quote
 
 
 
 
Jorge Matos
Guest
Posts: n/a
 
      10-21-2004
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

 
Reply With Quote
 
 
 
 
Wessam Zeidan
Guest
Posts: n/a
 
      10-22-2004
use a file field html control


"Stanley J Mroczek" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> 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

 
Reply With Quote
 
Jorge Matos
Guest
Posts: n/a
 
      10-22-2004
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" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> > 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

>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard drive is Disk 0 CHANGES to hard drive is Disk 1??? And still works!!! Spin Computer Support 7 04-09-2008 09:04 PM
Hard drive is Disk 0 CHANGES to hard drive is Disk 1??? And still works!!! Spin Windows 64bit 10 04-09-2008 09:04 PM
Assigning value to Browse button without using browse button in HTML balakrishnan.dinesh@gmail.com Javascript 0 10-12-2007 06:45 AM
how to check whether a drive is a network drive or drive from attached hard-disk shailesh Python 1 03-28-2007 12:57 PM
Internet Explorer 6 Can't Browse, Other Programs Browse Fine... Ike Computer Support 1 08-02-2005 09:20 PM



Advertisments