TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Smart Lucky
NA
555
640.9k
File Uploading in asp.net
Mar 28 2011 4:22 AM
Aslam-0-Alaikum
if (FileUpload1.PostedFile != null)
{
if (FileUpload1.PostedFile.ContentType == "jpg" || FileUpload1.PostedFile.ContentType == "gif" || FileUpload1.PostedFile.ContentType == "png")
{
if (FileUpload1.PostedFile.ContentLength == 20)
{
string fileName = FileUpload1.FileName;
FileUpload1.SaveAs(@"D:\" + fileName);
Response.Write("File Uploaded");
}
else
{
Response.Write("Image must 20 kb");
}
}
else
{
Response.Write("File must be Image");
}
}
else Response.Write("Please select file to upload");
it is not working idon't know but why ..............?
And
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/App_Data") + System.IO.Path.DirectorySeparatorChar + FileUpload1.PostedFile.FileName);
ystem.IO.Path.DirectorySeparatorChar What is mean this ....?
Reply
Answers (
2
)
How does ASP.NET store SessionIDs by default
how to display contents only after login