Tuesday, May 26, 2009

Virtual url to upload images

In order to get the physical address of a virtual directory use the following

1. if the page executing the request is directly under the root
MapPath("VirtualDirectoryName/");

2. If the page is somewhere under a child folder like

root/controls/upload.ascx

MapPath("../VirtualDirectoryName/");

No comments: