Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

movieClipLoader - Prevent Caching

Status
Not open for further replies.

joepeacock

Programmer
Nov 5, 2001
74
US
I need a way to prevent caching of JPG images loaded with the moveClipLoader method.

It seems like standard no-cache methods do not work because the image is loaded after the page has finished processing.

Does anyone know of a way to do this?

Joe
 
Are you dynamically loading these .jpgs?

With what code?

Just trying to prevent users from getting at them?
 
That is exactly what I am doing. Users can view smaller version images on the website, but do not have access to the full-size image. The page in question loads the full size image, but only displays a small part of it.

I am using Flash remoting tools to access a CFC service, which passes a query to the SWF. The query includes information about a photo. Since these photos are not stored on a browsable volume, I'm then using a MovieClipLoader() object to call a CFM page (with appropriate URL variables to identify the photo) which returns the appropriate file using CFCONTENT.

That CFM page appears in my cache directory and all I have to do is browse to the URL shown in my cache, complete with URL variables, or just rename the cached file to a .JPG and open it directly.

I'd like to prevent that, or I won't be able to use this tool.

Joe
 
In case anyone else ever needs to do this, here's the workaround I created:

1) Add a new field to the database called confString and fill it with random numbers for each photo

2) Add a new movie clip and a new MovieClipLoader object, below the boundaries of the movie, so it isn't visible when published.

3) Add the confString variable to the loadClip function that refers to the CFM page that pushes the JPG.

4) On that CFM, add the confstring check to the query that identifies the photo.
4a) If the query returns a record, run a query to update that record with a new, random confstring and push the file.
4b) If the query returns no records (ie the confstring is wrong), push a "Not available" image.

5) Add CFHEADER tags to the CFM page to prevent it from caching

6) Add a listener to the MovieClipLoader that, when the clip is finished loading, runs the new MovieClipLoader to load the same CFM page into the new movieclip, off the screen.

This will load the image, then load the "Not Available" image with the same file name, overwriting the file in the cache.

that's al. I doubt anyone will ever need this sort of thing, but just in case...

Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top