Mariam
Mariam

Reputation: 563

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 one can download it using download managers or any other http request that request this swf file

Upvotes: 0

Views: 5513

Answers (4)

Ahmadali Shafiee
Ahmadali Shafiee

Reputation: 4657

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.

Upvotes: 0

Alexander Beletsky
Alexander Beletsky

Reputation: 19821

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/

Upvotes: 1

user475434
user475434

Reputation: 316

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.

Upvotes: 0

Samuel Neff
Samuel Neff

Reputation: 74909

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.

Upvotes: 1

Related Questions