Hidden file extensions

792
3
11-29-2011 11:21 AM
CaseyBentz
Occasional Contributor II
I have just run into an issue where a user was saving a map using the fileReference.save method and it was saving without a file extension.  When the save file dialog box opens, the file extension is not visible.  Instead of showing up as map.pdf, it just shows map.  The user clicks save and it saves the file without a file extension.

fileReference.save(myPDF.save(Method.LOCAL), "Map.pdf");


I checked the users folder options and she had the hide file extensions for known file types option enabled.  I came back to my desk and enabled that option and the file extension was gone in the save file dialog box for me as well.  As I cannot control how my users select to customize their desktops, is there a way to fix this?  Has anyone else run into this?
Tags (2)
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Casey,

    For security reason you do not get control over the save dialog except the initial suggested file name as you have in your code. If Flash Player gave you ANY control or the file after the user has chosen the location hacks could do all kinds of evil stuff. So no you will have to inform all users to disable hiding file extensions in there OS.
0 Kudos
CaseyBentz
Occasional Contributor II
Thanks for the information Robert.
0 Kudos
TonyCollins
Occasional Contributor
Casey,

    For security reason you do not get control over the save dialog except the initial suggested file name as you have in your code. If Flash Player gave you ANY control or the file after the user has chosen the location hacks could do all kinds of evil stuff. So no you will have to inform all users to disable hiding file extensions in there OS.


We had this problem in an app a wrote a while back, but as there are thousands of users (that I don't know) I just saved the file with two extensions, e.g. "Map.pdf.pdf"

It works for users with and without extensions hidden!
0 Kudos