filereference

FileReference: Loading a Windows-locked file

I'm using Flex in Flash Player 10 on Windows, using FileReference to load a file into memory, as below. My issue is that when a file is locked by Windows, my FileReference is not giving me any feedback that the file is inaccessible--it simply never dispatches any events after my calling load(). Does anyone have insight into how to tell...

Adobe Air upload progress without FileReference

I'm deploying a small application with Adobe Air. My application will do batch upload from filepath which stored in a text file. For example, in a text file name "list.txt", there is a string "C:\myfiles\IMG_0001.JPG". Now I want to upload this image file, keep tracking of upload progress :-< I want to use FileReference to get the upload...

Flex: FileReference and Image unhandled IOErrorEvent

The following code shows a button that allows you to select a file (should be an image) and display it into an image component. When I select an invalid image (e.g. unsupported image type, a word document), I get the following error: "Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type." I know I can ...

FileReference.download() not working

I'm building a Flex app which requires me to download files. I have the following code: public function execute(event:CairngormEvent) : void { var evt:StemDownloadEvent = event as StemDownloadEvent; var req:URLRequest = new URLRequest(evt.data.file_path); var localRef:FileReference = new FileReference(); localRef.addEv...

How to call a FileReference.browse() from JavaScript?

Hello, I am trying to call the browse() method of the FileReference class from JavaScript (a user clicks on a text that uses the ExternalInterface to call a method in Flash). Unfortunately, I receive an error that tells me it has to be a direct action of the user (like clicking a button). I have searched through Google and realized thi...

Actionscript image download open custom viewer

Hi Gurus, i am downloading tiff images from WAMP server using our Flex AIR client. Using the following code for that. public static function requestDownload(id:int, defaultName:String):void { //POST params var urlVars:URLVariables = new URLVariables(); urlVars.action = "download"; urlVars....

AS3: FileReference ...

Let's say a user is starting to upload a file to the server via FileReference. What happens to that temporary file if the user cancels the upload or closes the browser? At what point is the server script called? Is the server script (in my case, ColdFusion) called only once the file has been successfully put on the server? I'm trying to...

flash cs4 file reference. Event.COMPLETE not called on a MAC,

Hi, I am working with a fileReference, however I'm having issues running on Safari on a MAC... EDIT The below example also doesnt work on Safari on a MAC... http://www.permadi.com/blog/2010/06/flash-as3-using-filereference-to-load-files-example-for-flash-cs4-and-above/ # The workflow on a PC runs as such: 1) Create file reference ...

Clearing eventListeners on a FileReference object

Hello all, I have a strange issue! I am trying to remove an event listener on a FileReference object by calling a function, but it seems not to be removed, and I do not understand why. Here is the code: private function clearFileUploadListeners(file:FileReference, index:String):void { var dispatchEvent:Function = function(event:Ev...

Limit on FileReference uploads?!

Hello, I am currently uploading files in ActionScript 3 using the upload() method of the FileReference class. I built an uploader than can do simultaneous or parallel uploads, having a variable set the number of maximum uploads at a time. I noticed that for Internet Explorer I could be uploading 10 or more files simultaneously, but Fi...

Flex 3 FileReference not updating when new file is created

I am trying to allow download of a particular file that the user has generated (or will generate). If they try to download the file AFTER generating, the fileReference does not seem to create the new object (it downloads the old file). Code is something like this: private function downloadFile():void { var node:XML = XML(myTree.se...

Storing a FileReference in a SharedObject

Hello, I would like to store a FileReference object somehow and load it when the SWF loads again. I tried to use the SharedObject class but it does not seem to work. I suspect that what I want to do is not doable due to security issues (not using Adobe AIR), but I wanted to check. Does anyone please know if there is anyway to store a ...

Flex FileReference upload() and .data ... does this load the whole file into memory?

Hi all, I need to upload a very large file to my server, through my Flex application, and I see that Flex Filereference upload() seems to be able to handle it. Does the upload() methods uploads a 'stream' to the servlet, or does it sends the whole ByteArray (As I understand it, the ByteArray will have the whole file contents, so a >1Gb...

Can Action Script FileReference object be sent to Javascript and converted to File object ?

In Action Script, FileReference.browse() is called. I would like to send the chosen file to Javascript and convert it to File object, just like if I would press the Browse button of the <input type='file /> and got File object. I need that to be able to display picture thumbnail like shown here. Maybe instead of passing the whole obje...

Passing an AIR file to ActionScript as a FileReference?

Hello, This might be an awkward question, I apologize in advance. I made a program to upload files and it uses FileReference. I want to have an AIR version of this program, but allow to pick a whole folder. So far, I was able to get this behavior through AIR using AIRAliases.js in JavaScript. I am able to create File objects but I won...

Flex's FileReference.save() can only be called in a user event handler -- how can I get around this?

I need to call FileReference.save() after a web service call has completed, but this method has a restriction: "In Flash Player, you can only call this method successfully in response to a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling this method results in Flash Player throwing an ...

Is it possible to download multiple files from a remote location to a users hard drive with AS3 FileReference?

Can I develop a Flash AS3 download swf that will let a user select a location on their hard drive to download files to and then start the download of multiple files (in the same way I can do with upload)? Or should I zip all the multiple files first and download zipped files to local disk. My users will want to download potentially hun...

Flex 4 fileReference selected image file dimmensions (width and height)

Hello! I use a fileReference.browse() to select an image file from the harddrive. How can I check the Width and Height of the selected image file please? Thank you! ...

Saving a file in Flex Air

Hi there, I'm trying to copy my SQLite file that is used in my Air app to user's selected directory using var fileSaveDest:FileReference = new FileReference(); fileSaveDest.save(dbWorkedFile,'Inventory.DB'); dbWorkedFile is a File dbWorkedFile = File.documentsDirectory.resolvePath("Inventory.db"); I tried this but the saved file i...

flex upload file component - problems with filereference

Hi, The following code is used in a component I name FileUpload.mxml which is used in two three different sections of the flex application. private var uploadURL:URLRequest = new URLRequest; private var file:FileReference = new FileReference; private var media:MediaFacade; public function browse():void { var uUrl:String=""; //...