The FileUpload control requires me to provide a rooted directory in the SaveAs() method. However, I would much rather the uploaded files go into a virtual directory, such as ‘~/UserFiles/[username]/[filename]’. Is there a way for me to accomplish that?
The FileUpload control requires me to provide a rooted directory in the SaveAs() method.
Share
Use the pages MapPath method:-