how to file upload in aps .net 3.5

Posted by Suneel161 under Regular Expressions on 4/29/2010 | Views : 2502 | Status : [Member] | Replies : 2
hii
in my form 3 textboxes(firstname,lastname,technology,) and one file upload button.when i upload file will be save to databese firstname+technology.how to rename the file and the path will be save to database and file will be save to particular folder,how to solve this problem.any one give example




Responses

Posted by: Muhilan on: 4/30/2010 [Member] Starter

Up
0
Down
try like this

FileUpload1.PostedFile.SaveAs(Server.MapPath("firstname+technology.jpg"));

Save the image path to DB with (firstname+technology.jpg)

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

Posted by: Pavanandey on: 4/30/2010 [Member] Bronze

Up
0
Down

string extension = System.IO.Path.GetFileName(hif.PostedFile.FileName).ToLower();
fileuploadcontorl.PostedFile.SaveAs(storePath + "/" + firstname+technology+ "_" + extension);
where storePath is the physical path u want to save the file
firstname+technology is the file name
extension is the extension of the file

Thanks
Pavan Kumar
Mark Answer if this fits the need

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

Login to post response