Protect Flash Files from Being Downloaded

本文介绍了一种防止Flash文件被下载的方法,通过使用PHP脚本和.htaccess文件限制对SWF文件的直接访问。此方法适用于想要保护自己Flash内容不被盗用的网站开发者。

Protect Flash files from being downloaded with this technique. It is not fool-proof, but this takes a completely different approach to stopping the average user trying to get at your SWF files than other tactics.

 

Thanks to Graham Ellis for the awesome time he donated to help me understand some of the finer points of PHP. He is a true PHP genius!

Protecting Flash files: the example

Try your hand at downloading the Flash .swf movie in this example.

.htaccess

Create a file called .htaccess in the root folder on your server if you don't already have one, and insert the following line to it:

Modifying your htaccess file by adding this line will not affect other Flash files on your website.

 

The HTML

You need to add two things to the page that the Flash movie will play on; first, add lines 1-3 to the very top of your page. And second, add lines 9-11 to your page directly above the object tag. Lastly, change the extension of the page to .php so your server will know to parse the language instead of writing it to the page.

 

The PHP

Here's where the real muscle comes in. While the HTML calls for flash.swf, it won't technically be a Flash file; it'll be a PHP file. Create a new file on your computer called flash.txt, open it up to edit, and insert the following code into it. Upload the file to your server and change the extension from txt to swf. This is the file that your HTML will link to instead of the real Flash movie.

The only change you need to make to this file is on line 21. Replace /home/www/private/flash.swf with the full server path to the Flash movie you want to play. If you don't know your full server path, you can find it by creating this PHP file and viewing it in your browser:

The ideal spot to put the real .swf file would be a place on your server where browsers can't go such as a password protected directory or in a private folder outside of the document root.

How does this protect my Flash files from being downloaded?

The first thing that happens is the HTML page creates a session (sessions are kind of like cookies) and then it opens the PHP script as if it were a genuine Flash file. The session contains the domain of the site, and a quick check is performed to see if the domain requesting the flash file is the same as the domain where the flash file is located. If it doesn't match or the session was never created, the page simply reads, Permission Denied.

Update: 8 August, 2007

A couple of ways to get around this preventative measure have been brought to my attention, so consider this method a way to slow down experienced hackers. Personally, if I ran into this being used on a Flash file that I wanted to download, I would shrug my shoulders and give up.

Update 2: 18 January, 2010

I've been looking into making use of HTTP headers to improve the performance of my site, and I realised a couple of them might be useful for this example. I added a no-cache header and an expire header that's in the past. This might prevent people from being able to download a Flash file from their cache, but I haven't done any testing.

Contact me if you have any ideas or info about this.

Terms and Conditions

By using this information, you consent to the following:

In no event shall I be held liable for any damages whatsoever (including, without limitation, incidental and consequential damages, lost profits, or damages resulting from lost business) resulting from the use or inability to use the material on this website.

 

 

link:http://ryanfait.com/resources/protect-flash-files-from-download/

<think>好的,我现在需要分析用户的问题:“work order already downloaded files cannot be deleted 有语法错误吗”。用户想知道这个英文句子是否有语法错误。首先,我需要仔细看一下原句的结构。 原句是“work order already downloaded files cannot be deleted”。首先,主语部分看起来是“work order already downloaded files”,这里可能有问题。通常,“work order”作为主语,后面应该有一个修饰它的定语,而“already downloaded files”可能需要正确的连接词或结构。 比如,正确的表达可能是“Work orders with already downloaded files cannot be deleted”,这里用“with”来连接“work orders”和“downloaded files”,这样结构更清晰。或者使用定语从句,如“Work orders that have already had their files downloaded cannot be deleted”,这样更明确地说明文件已经被下载。 另外,原句中的“already downloaded files”作为后置定语修饰“work order”可能不太合适,因为“work order”和“files”之间的关系不够明确。可能需要使用介词或从句来正确表达这种关系。 还要注意主谓一致的问题。如果主语是复数形式,比如“work orders”,那么动词也应该用复数形式,但原句中的“cannot”是正确的,因为“work orders”是复数的话,动词不需要变化。不过原句中的“work order”是单数,所以可能需要调整。 此外,时态和冠词的使用也需要检查。例如,“work order”前面是否需要加冠词“a”或者“the”,但通常在系统提示中可能不需要,尤其是在技术文档中常省略冠词。不过这可能不是语法错误,而是风格问题。 总结可能的错误点: 1. 主语和修饰语之间的结构不清晰。 2. 可能需要使用介词或从句来正确连接“work order”和“downloaded files”。 3. 主谓一致是否正确(如果主语是单数的话)。 接下来,我需要考虑用户可能的背景。用户可能是在处理系统提示信息,需要确保英文翻译准确且专业,可能用于软件或工作流程中的错误提示。因此,正确的语法和清晰的表达非常重要,尤其是在技术文档中,语法错误可能导致用户困惑或不符合行业标准。 用户的需求不仅仅是判断是否有语法错误,可能还希望得到更准确的翻译建议,以及相关的扩展问题,比如其他类似情况的翻译或术语解释。因此,在回答时不仅要指出错误,还要提供修正后的例句,并可能延伸到相关问题,帮助用户全面理解。 现在,我需要确认我的分析是否正确。比如,“work order already downloaded files”中的修饰关系是否正确。正确的结构应该是“work orders with downloaded files”或者类似的表达方式,以明确工单和文件之间的关系。另外,使用“already”是否正确,通常“already”放在完成时态中,比如“have been downloaded”,所以原句中的结构可能不正确,应该调整时态和副词的位置。 因此,原句存在语法错误,主要是结构问题和时态副词的位置问题。正确的表达应该使用被动语态,如“have already been downloaded”,并且需要使用适当的连接词来连接主语和修饰语。 </think>"Work order already downloaded files cannot be deleted" 存在语法问题,主要体现在以下两点: --- ### **1. 修饰关系错误** 原句结构: **"Work order already downloaded files"** → 逻辑混乱:`already downloaded` 被误解为直接修饰 "work order",而非 "files"。 **修正**: - 使用介词连接: `"Work orders with already downloaded files cannot be deleted"` - 使用定语从句: `"Work orders that have already had their files downloaded cannot be deleted"` --- ### **2. 时态与被动语态缺失** 原句中的 `already downloaded` 是过去分词短语,但缺少被动语态的助动词(如 `have been`),导致时态不完整。 **修正**: - 添加被动语态: `"Work orders with files that have already been downloaded cannot be deleted"` - 简化表达(技术场景常用): `"Work orders linked to downloaded files cannot be deleted"` --- ### **标准技术提示写法** ```plaintext Error: Work orders with downloaded print files are non-deletable to ensure document integrity. ``` --- ### **术语优化建议** - **"Downloaded" vs. "Exported"**: - `Downloaded`:强调用户主动操作(需记录操作者ID)。 - `Exported`:仅表示系统内文件生成(无需用户交互)。 - **"Non-deletable" vs. "Cannot be deleted"**: - `Non-deletable` 更简洁,适合技术文档; - `Cannot be deleted` 更口语化,适合用户界面。 --- ### **场景化示例** - **审计合规场景**: `"Work orders with downloaded files cannot be deleted to comply with FDA 21 CFR Part 11 audit requirements."` - **状态限制场景**: `"Action denied: Work order status is 'Print Files Downloaded' – deletion is only allowed for 'Draft' status."` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值