3692
3692

Reputation: 628

to change the path of the file

I am trying to use fileupload tag to upload a file. What it basically does is, it saves the file into the follwoing directory:

C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\

Can someone please tell me how to change this path and save the upload file into some other directory?

Upvotes: 0

Views: 83

Answers (2)

huMpty duMpty
huMpty duMpty

Reputation: 14470

FileUpload1.SaveAs(savePath);

read more about FileUpload.SaveAs Method

Upvotes: 1

3692
3692

Reputation: 628

You have the complete control of this. If you want to the file saved to a different path, then use this :

fileUpload.PostedFile.SaveAs("c:\my path\" + fileUpload.FileName);

Make sure it (folder) has permissions

Upvotes: 1

Related Questions