Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > File Uploading

Reply
Thread Tools

File Uploading

 
 
Brian Pittman
Guest
Posts: n/a
 
      02-20-2009
Hi,

When uploading a file it tells me that the HasFile property is false
even though a file has been selected through the FileUpload control.
What is even stranger is it uploads the file to root of the web folder
and created a zero byte file with the file name in the directory specified.

Below is the code I used to upload the file.

if (file.HasFile)
{
file.SaveAs(Server.MapPath("\\files\\") + file.FileName);
}

Basic code, but should work none the less. I have created many apps
that required uploading, this is the first time I have encountered this
problem. Though I have just switched to VS 2008 and Vista Ultimate.
Perhaps one of these could be the problem?

Regards,

Brian
 
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
ftp uploading vs. control panel uploading Dung Ping HTML 10 01-16-2006 10:43 AM
Uploading a file without 'file' as input type John Scalco ASP .Net 1 06-09-2004 08:54 PM
Re: Uploading a file to a file server?!? ScottFrye ASP .Net 0 10-21-2003 12:48 PM
Re: Uploading a file to a file server?!? George Ter-Saakov ASP .Net 1 10-21-2003 12:38 PM
Re: Uploading a file to a file server?!? Tom ASP .Net 1 10-21-2003 12:35 PM



Advertisments