从分层体系结构中的用户的admin目录访问映像文件。 [英] Access image file from admin directory in user in layered architecture.

查看:89
本文介绍了从分层体系结构中的用户的admin目录访问映像文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,



目前我在一个基于分层架构的项目中工作,所以基本上管理面板是一个项目,用户面板是另一个项目,



但问题是管理员上传了一些存储在管理项目文件夹中的图像,但上传的图像也显示在用户面板中,这是同一解决方案中的其他项目。 br />


那么,如何在同一解决方案中使用存储在数据库中的图像名称从用户项目访问admin项目的图像文件夹。



提前致谢。

解决方案

1.如果admin project是一个Web应用程序而user project是第二个web应用程序,您无法从第二个应用程序中的第一个应用程序访问该文件夹,反之亦然。



此案例的一个解决方案是将文件存储在数据库中,保存在image类型的字段中,而不是保存在文件夹中。



2.如果两个项目都属于同一个Web应用程序,则可以使用相对于Web应用程序根目录的路径访问该文件夹,如下一个示例所示: 〜\SomeSubFolder\DocFolder

Hello All,

Currently i am working in a project which is based on layered architecture so basically admin panel is one project and user panel is another project,

but the problem is that admin upload some images which stored in a folder of admin project but the uploaded images also shown in user panel which is other project in same solution.

So,how can i access the image folder of admin project from user project in same solution with the image name which is stored in database.

Thanks in advance.

解决方案

1.If "admin project" is a web application and "user project" is a 2nd web application, you cannot access the folder from the 1st application in the 2nd application and viceversa.

One solution for this case is to store the files in the database, saved in field of type "image", and not in the folder.

2.If both projects are part of the same web application you can access the folder by using path that are relative to the web application root, like the next example: "~\SomeSubFolder\DocFolder".


这篇关于从分层体系结构中的用户的admin目录访问映像文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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