Download and cache in the issue of AIR

Hi guys

I did a program using AS3, AIR and php to search a remote directory and download the mp3 file to a folder on my local computer.

It works very well.  However, even if I delete the mp3s downloaded into the folder on my local machine and test, the program 'instantly' seems to fill the folder with mp3s once again, as if it is bring some windows temp folder and not worry about the re - download.

I was wondering if the above is the case and, if so, if there is a way to force them to download the file, even if it resides in a folder temp somewhere?

This is the code that is called for each file:

var mp3File:File = File.userDirectory.resolvePath("Downloads/"+saveFileNameVar;)

var fs:FileStream = new FileStream();

FS. Open (mp3File, FileMode.WRITE);

fs.writeBytes (loader.data);

FS. Close();

mp3File.downloaded = true;

Thanks for your help.

Shaun

> I was wondering if the above is the case and, if so, if there is a way to force them to download the file, even if it resides in a folder temp somewhere?

You want to change the call to the server, receives it the file. The usual way is to add a random number as a parameter to query - something like:

myLoader.load (new URLRequest ("http://somedomain.com/script/getMusic.php?r=" + String (Date .valueOf (()) () ") new;)

Tags: Adobe Animate

Similar Questions

Maybe you are looking for