fileupload control tool

Posted by Mona.Agr1186 under ASP.NET on 3/23/2013 | Points: 10 | Views : 839 | Status : [Member] | Replies : 1
I am using fileupload control tool when we upload any file and when i am preform some other event then that upload file will remove
and save to null value




Responses

Posted by: aswinialuri-19361 on: 3/23/2013 [Member] Starter | Points: 25

Up
0
Down
Hi
Try this code i think it is very useful to you

if (FileUpload1.HasFile)
{
if (FileUpload1.PostedFile.ContentType == "image/jpeg" || FileUpload1.PostedFile.ContentType == "image/gif" || FileUpload1.PostedFile.ContentType == "image/x-png" && FileUpload1.PostedFile.ContentLength == 1024)
{
string path = "~/Images/" + FileUpload1.FileName;
FileUpload1.SaveAs(Server.MapPath(path));


Image3.ImageUrl = "~/Images/" + FileUpload1.FileName;
Image3.Visible = true;
Thanks&Regards
Aswini Aluri


Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

Mona.Agr1186, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response