views:

232

answers:

1
In flex when I allow user to download a file using : 
             dwFile = new FileReference();
             dwFile.download(downloadURL, dwFileName);
Is there a way to ensure that the downloaded file always ends up with the extension .tar or any other extension for that matter? By default I give it a name like xyz.tar,
but as of now the user can tamper with filename, including its extension. Can
I prevent him from doing so?

A: 

why not eliminate the ability to modify the extension and make it only the file name....

dwFile.download( downloadURL, StringUtil.substitute("{0}.tar", dwFileName) );
Shua
tried this. doesn't make any difference at all. In the download dialog box, filename is still shown as xyz.tar, and I can still tamper with the extension.
dta
oooohhh I know what you mean now.... yea I don't think there is anything you can do about that.
Shua