Reputation: 428
I have a web application developped using as3. The problem is that these application loads some image files, and add my watermark to them. What is happening is that these images are being cached by the browser, allowing the users who know how to access the tmp folder, to get these files, without my watermark.
Adding the watermark previously to the image, is not an alternative for me, due the fact that when the a premium user is logged in the watermark is not added.
How can I disable the caching?
Thanks.
Upvotes: 1
Views: 568
Reputation: 6402
You can not do this client side.
There is no way to not put the image in the cache folder.
Plus if the client really wanted to they could just use HTTPFox and grab the location of the file and download it directly.
Your best bet is to use imagemagick or a library like it and add the water mark right into the image.
You need to check the session of the user and if it is premium or not.
Then pass the image with or without the mark.
Upvotes: 0
Reputation: 12527
You have mentioned that adding a water-mark server-side is not a possibility. If that is the case, you will not find a solution. Flash loads the images using HTTP, which means every browser will send an HTTP header request. So any relatively advanced user can see the HTTP traffic from the server and get the image. They don't need flash, or the temp directory or anything like that to get it. They just request the resource again, and your server will serve it.
The only solution to this problem is server-side.
Upvotes: 0
Reputation: 17217
you might have to apply the watermark to the image server-side, for example using PHP, then load the image into Flash. using PHP should also disable the ability of users getting the location of your raw image by decompiling your .swf (which is extremely easy to do).
also, you should be using the Loader class to load images instead of URLLoader.
Upvotes: 3