Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-03-2008, 03:46 PM   #1
Corbin U
corbo950's Avatar
Join Date: Jun 2008
Location: michigan
Posts: 241
Question file extentions

is there away to set the file extension when saving a file out of an AIR application?
corbo950 is offline   Reply With Quote
Old 07-03-2008, 10:39 PM   #2
2006 Man Of The Year
evride's Avatar
Join Date: Mar 2007
Posts: 919

you can do so in the resolvePath() function.

ActionScript Code:
var file:File = File.desktopDirectory.resolvePath("image.jpg"); trace(file.type); // this will get you the file extension and this is a read only property, cannot set.

As long as people believe in absurdities they will continue to commit atrocities. --Voltaire
evride is offline   Reply With Quote
Old 07-06-2008, 10:56 PM   #3
johnnyboy's Avatar
Join Date: Nov 2005
Location: Stockholm
Posts: 480
Send a message via MSN to johnnyboy

Hey man,

Were u thinking about actually changing the format of a file or?

Let's say you load in a JPG, you could convert it and save it as a PNG via BitmapData and the adobe image encoder classes.

Just a thought, if that was ur interest

johnnyboy is offline   Reply With Quote
Old 07-25-2008, 02:38 AM   #4
Corbin U
corbo950's Avatar
Join Date: Jun 2008
Location: michigan
Posts: 241

no i was just am having people export a csv file and didnt want them to have to type in .csv and i got it set
corbo950 is offline   Reply With Quote
Old 02-24-2011, 01:35 PM   #5
Registered User
Join Date: Feb 2011
Location: NJ - USA
Posts: 4


My first post on this forum. I have a similar situation in my Air program where I need to have the user save the file in a specific location with a specific name natively. The default extension is .pdf but if they change the file's name and don't add the .pdf extension, silly Adobe won't recognize this as a pdf file and all hell breaks loose. This happens only in Windows environment. I wish someone can help me out there, my function to call the save:

public function mergeComplete(outputFile:File) : void {

				var byteArray:ByteArray = new ByteArray();
				var fileStream:FileStream = new FileStream();
				fileStream.open(outputFile, FileMode.READ);
				outputLocation.addEventListener(Event.SELECT, selectHandler);
				outputLocation.save(byteArray, "myFile.pdf");
Thanks, I await some responses.
OrganicChem is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I make a clip wait before loading? shoodogg1977 ActionScript 1.0 (and below) 4 09-01-2006 01:08 PM
array from external text file loop problems shrinkwrapped ActionScript 2.0 4 07-17-2006 10:59 PM
File upload to a different server thedjmixman Components 0 06-11-2006 12:02 PM
how to open pdf file from projector file in acrobat reader sohailfx ActionScript 2.0 2 06-24-2005 05:54 PM

All times are GMT. The time now is 06:36 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.