开发者

how to prevent download any files (specially swf) from IIS server

i have a asp.net website i have some files swf files that i want to prevent downloading them

is there a solution that the IIS can have a passord for downloading the file swf file and i can provide this password in some situations on the server that i can pass this password in the code

so that the swf file can be viewed from my page only as provide the password

but no on开发者_如何转开发e can download it using download managers or any other http request that request this swf file


Don't put the swf file under your web root. Put it somewhere else like C:\Inetpub\assets. Then use a .NET page or handler to provide the file upon request.

http://yoursite.com?GetAsset.ashx?filename=whatever.swf

Then the request will be part of the same session as the rest of your application and you can validate that the user is really allowed to download the swf.


You can configure IIS Authorization, to allow only authenticated user to access your resouces:

http://learn.iis.net/page.aspx/142/understanding-iis-70-url-authorization/


can you create ftp accounts on your server ? if yes , create a folder only accessible with the credentials you set then put the swf files in it ( i guess you are using a distant IIS server ). Your hosting service may provide an admin interface were you can set some ftp accounts. The user will have to access your files with a ftp client application.


there is something named Mine Types. If you add a Mime Type and set an extension like .swf to that you allow client to download and see all .swf files of the server. just go to Mime types tool of IIS and remove ones that you want to prevent downloading.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜