且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在ASP.NET MVC 5中上载文件

更新时间:2023-02-11 09:47:33

使用
<img src="" /> 





首先检查图像是否存在于服务器文件夹中,如果不存在则将其从数据库下载到服务器文件夹。



然后你可以直接使用图像路径,例如





First check the image is present in server folder or not, if not present download it from database to server folder.

Then you can directly use the image path like

<img src="/ImageFolderName/Subfoler/image.jpg">
</img>





其实问题是





Actually problem is

@item.ImageServerPath





此变量包含服务器的图像文件夹路径。浏览器不需要此完整路径。使用firebug检查图像src ..您将获得有关错误的更多详细信息..



This variable contain image folder path of server..This full path is not required in browser. Use firebug check the image src..You will get more details about your error..