Can't load image from project folder in Orchard module

后端 未结 1 833
刺人心
刺人心 2021-01-13 09:11

I\'m trying to insert a image in my Orchard module, but I\'m having some problems.



        
相关标签:
1条回答
  • 2021-01-13 09:23

    Try placing the following web.config file inside the img folder.

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <appSettings>
        <add key="webpages:Enabled" value="false" />
      </appSettings>
      <system.web>
        <httpHandlers>
          <!-- iis6 - for any request in this location, return via managed static file handler -->
          <add path="*" verb="*" type="System.Web.StaticFileHandler" />
        </httpHandlers>
      </system.web>
      <system.webServer>
        <handlers accessPolicy="Script,Read">
          <!--
          iis7 - for any request to a file exists on disk, return it via native http module.
          accessPolicy 'Script' is to allow for a managed 404 page.
          -->
          <add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
        </handlers>
      </system.webServer>
    </configuration>
    
    0 讨论(0)
提交回复
热议问题