dimanche 25 mai 2014

Création d'un chemin d'accès virtuel dans asp.net/Azure - Stack Overflow


We are moving a web app to the MS Azure environment and had to change where photos are stored. Azure uses a blob environment that we access via a mapped cloud drive. We dynamically set the drive letter at app start. All of this is working fine and the pictures save correctly.


We need to set a URL path to these pictures so that users can view them. In the old app, that worked fine because they were stored within the app environment but now they are outside. How can I set a mapping for something like http://myapp.com/photos/abc.jpg will point to h:\abc.jpg?




It sounds like all you need to do is create a virtual directory in IIS in the root of your application called photos that is mapped to h:\.


To do this, open IIS Manager, right-click on your site, and select Add Virtual Directory.... Set the alias to photos and the physical path to h:\.



We are moving a web app to the MS Azure environment and had to change where photos are stored. Azure uses a blob environment that we access via a mapped cloud drive. We dynamically set the drive letter at app start. All of this is working fine and the pictures save correctly.


We need to set a URL path to these pictures so that users can view them. In the old app, that worked fine because they were stored within the app environment but now they are outside. How can I set a mapping for something like http://myapp.com/photos/abc.jpg will point to h:\abc.jpg?



It sounds like all you need to do is create a virtual directory in IIS in the root of your application called photos that is mapped to h:\.


To do this, open IIS Manager, right-click on your site, and select Add Virtual Directory.... Set the alias to photos and the physical path to h:\.


0 commentaires:

Enregistrer un commentaire