First of all, let’s get the overview of both.
Physical path - This is the actual path the file is located by IIS.
Virtual path - This is the logical path to access the file which is pointed to from outside of the IIS application folder.
Let’s display this image from Hard-drive ‘E’ using a virtual directory in IIS Default web site.
![iis_0](/KB/session/1132566/iis_0.png)
Add Virtual Directory
![iis_1](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)
Here, we need to provide an alias for the physical path.
- Physical Path: E:\Files
- Virtual Path: http://localhost/Files/
- File Name: image_60140ec0-ce46-4dbf-a14f-4210eab7f42c.png
- Full Path: http://localhost/Files/image_60140ec0-ce46-4dbf-a14f-4210eab7f42c.png
![iis_3](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)
![iis_4](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)
![iis_5](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)
Let’s Enable Directory Browsing
![iis_6](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)
By default, this is disabled for security reasons.
![iis_7](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)
Here, we can see the files in folder that is in E - drive.
![iis_8](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)
Click on the file name, it will load the file which is out of IIS application folder.
![iis_9](data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==)
Thanks for reading. Hope this will help!