在WebApi问题中将图像文件夹访问为URL ..! [英] Image folder access as URL in WebApi issue ..!

查看:76
本文介绍了在WebApi问题中将图像文件夹访问为URL ..!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have Image folder in hosted WEB API, while accessing image with URL "http://localhost:49245/images/abc.png" is working fine at local end, but not on hosted site at server. Showing "500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed." I have already added :

<location path="Images">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>

But still not working. Please suggest.

推荐答案

回答你的问题是不可能的。 500错误意味着服务器上运行的代码崩溃。由于我们无法看到该代码,因此无法告诉您发生了什么。



很有可能您对代码从哪些对象中获取了一些假设一个方法或属性获取器,你没有检查你是否确实得到了有效的东西。然后你尝试使用它,比如尝试在null上调用方法或属性。
It's impossible to answer your question. The 500 error means that the code running on the server crashed. Since we can't see that code, it's impossible to tell you what happened.

Chances are really good you made some assumptions about what objects the code would get back from a method or property getter and you didn't check to see if you actually got something valid back. Then you tried to use it, like trying to call a method or property on null.


这篇关于在WebApi问题中将图像文件夹访问为URL ..!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆