imageresizing.net混杂文件系统(数据库驱动链接到数据文件的文件系统) [英] imageresizing.net on hybrid file system (Database Driven linked to data files on file system)

查看:208
本文介绍了imageresizing.net混杂文件系统(数据库驱动链接到数据文件的文件系统)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我偶然发现了ImageResizer从ImageResizing.net,我想知道我怎么会整合这与我的网站。我们有很多的文件\\我们认为对公众开放,然后我们有别人认为是私人的图像。我们有我们所有的图像在通过URL不能访问Web服务器安全的文件夹,我们必须链接到这些文件的数据库。我们使用网络处理器(ashx的)将图像传送给用户(网页等),因为对用户是否被允许查看一个文件中的规则是很多比他们属于只是什么作用更加复杂。例如,有些图像只允许有用户,我们已发送给(数据库保持这种关系信息)的请求观看。我们不存储在数据库中的文件/图片作为Blob,因为这会大大增加我们的数据库大小(使用SQLServer的防爆preSS所以需要留下10GB的限制),加上我认为这会造成性能的影响,但我可能是错的。随着中说的是使用ImageResizer最好的办法?

I stumbled upon the ImageResizer from ImageResizing.net and am wondering how I would integrate this with my website. We have a lot of files \ images that we consider opened to the public and then we have others that are private. We have all of our images in a secure folder on the webserver not accessible via the url and we have a database that links to these files. We use a web handler (ashx) to deliver the image to the user (Web pages etc) because the rules on if a user is allowed to view a file is a lot more complex than just what role they belong to. For instance some images are only viewable to users we have sent a request to (the DB holds this relationship info). We don't store the files/images in the DB as Blob because this would greatly increase our DB size (using the SQLServer Express so need to stay under the 10GB limit) plus I think it would cause a performance impact but I could be wrong. With that said what is the best approach to using the ImageResizer?

我读了一些关于IViertualImageProvider,我想我会写使用此格式( HTTP插件: //imageresizing.net/docs/extend/virtualimageprovider )。我只想把我的身份验证/授权逻辑在这里,以确定是否图像传送与否。有没有更好的办法?已经有人已经建立了一个插件这种情况?

I read some about the IViertualImageProvider and I think I would have to write a plugin using this format (http://imageresizing.net/docs/extend/virtualimageprovider). Would I just put in my authentication / authorization logic here to determine if an image is delivered or not. Is there a better way? Has someone already built a plugin for this scenario?

推荐答案

这就是所谓的授权。你可以在你的HttpApplication或IHttpModule的的的AuthorizeRequest 事件实现授权逻辑。

This is called Authorization. You can implement authorization logic in your HttpApplication or IHttpModule's AuthorizeRequest event.

ImageResizer还提供了只适用于处理图像的 AuthorizeImage 事件。如果您的图片文件系统上或由提供的VirtualPathProvider,他们不通过ImageResizer去访问,所以你应该使用的AuthorizeRequest的方法。

ImageResizer also offers a AuthorizeImage event that only applies to processed images. If your images are on the file system or provided by a VirtualPathProvider, they're accessible without going through ImageResizer, so you should use AuthorizeRequest approach.

这篇关于imageresizing.net混杂文件系统(数据库驱动链接到数据文件的文件系统)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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