fileupload files how to generate url ? [Resolved]

Posted by Chandru_ra under Regular Expressions on 4/23/2011 | Points: 10 | Views : 2597 | Status : [Member] | Replies : 3
hi friends,

now am using fileupload control. am select photo or any one files. that files automatically generate url types.. how?

help me




Advance Thanks

chandru


Responses

Posted by: Prabhakar on: 4/23/2011 [Member] [MVP] Starter | Points: 50

Up
0
Down

Resolved
Hi Chandru_ra

u want to full url when u save ur fole in a folder by FileUploader . . write this code . .

string path = Server.MapPath("download/");

string fnam = FileUpload1.FileName;
path += fnam;
FileUpload1.SaveAs(path);


in a path ur full URL

Best Regard's
Prabhakar

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

Posted by: Chandru_ra on: 4/23/2011 [Member] Starter | Points: 25

Up
0
Down
hi, friend

am using ur code but not generate for url.. how?
protected void btnUpload_Click(object sender, EventArgs e)
{
//imageName = System.IO.Path.GetFileName(FileUpload1.FileName);
if (FileUpload1.HasFile)
{
string path = Server.MapPath("Audio/");
string fnam = FileUpload1.FileName;
path += fnam;
FileUpload1.SaveAs(path);
imagefile = "Audio" + imageName;
}
else
{
imagefile = "Audio/No.files.jpg";

}

Advance thanks

chandru

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

Posted by: Prabhakar on: 4/23/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi chandru,


that's a ok . . code are usable for you . .

Best Regard's
Prabhakar

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

Login to post response