Questions tagged [filereference]

A file reference is an object that allows programs to refer to files on a file system, and operate on them. Browser-based applications (e.g. JavaScript and ActionScript) need them to save and upload files to / from the user's file system because all file system interaction is policed by the browser itself.

A file reference is an object available in most programming languages' libraries.

In ActionScript, file upload and download must be done through the FileReference class, and the Flash Player has to channel those requests to the hosting browser.

171 questions
12
votes
6 answers

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…
James Adams
  • 7,338
  • 18
  • 68
  • 113
11
votes
6 answers

How to remove reference of file Xcode?

I had removed some files from my iOS project a while back and thought they had been completely deleted. After a long time I created another class which unfortunately had the same name as one of those that I had removed from my project (but the…
A Salcedo
  • 6,130
  • 7
  • 28
  • 42
8
votes
8 answers

Alternative to locking file type on FileReference.save() AS3

Update: As discussed in Jacob's reply below, limiting or correcting the behaviour of FileReference.save isn't possible. Can anyone suggest an alternative (server is Apache/PHP) that matches all of my criteria from this post and avoids the pitfalls…
shanethehat
  • 15,105
  • 10
  • 54
  • 84
8
votes
2 answers

Image Upload progress using URLLoader AS3

I am developing image uploader in Flash. I use FileReference.browse to browse image then resize this image to 1000 x 1000 px, if the image is very big and then upload to server. I want to show progressbar for the image upload progress. I am usinng…
Neeraj Khanna
7
votes
1 answer

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…
6
votes
2 answers

Can't write local files in Flash Player 10+ online (but works when used locally)

I am trying to write a local file with Flash Player 10+ using the FileReference class, following the format from this blog post by Mike Chambers:…
Steven
  • 1,729
  • 2
  • 16
  • 30
6
votes
1 answer

Need help using NtCreateFile() to open by fileIndex

I have written a program that queries the change journal records and lists them. The change journal returns: 1) filereferencenumber( combination of fileindex.high and fileindex.low) 2) parentfilereferencenumber(same as above except it is for…
roymustang86
  • 6,418
  • 19
  • 60
  • 96
6
votes
4 answers

Flex: DeepCopy of FileReference

in my project, I let users pick pictures using the FileReference class. I then load these pictures into their .data properties, using the load() function. After this I perform some local manipulation and send them to the server. What I would like to…
6
votes
4 answers

How can you save out a String into a file in AS3?

I have a string the user has typed and I want to save it into a file on the users harddrive. Can you do that? And if so, how?
None
5
votes
2 answers

How to find which file was the "initiator" Python

Situation: We know that the below will check if the script has been called directly. if __name__ == '__main__': print "Called directly" else: print "Imported by other python files" Problem: The else clause is only a generic one and will…
Timothy Wong
  • 565
  • 1
  • 5
  • 24
4
votes
1 answer

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

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…
Rudy
  • 259
  • 1
  • 13
4
votes
3 answers

How to point to a file stored in project folder? WPF

At the moment I'm pointing to a file on my machine, but I'm wondering how I would point the string to a folder I created within the project. For example the path to the folder in visual studio is, C:\Users\Drian Darley\documents\visual studio…
Brian J
  • 5,416
  • 19
  • 94
  • 189
3
votes
3 answers

actionscript 3 filereference 'save' throws error

i have a code which saves a display object locally as an image file, but at some point it began throwing error 2174. this code is called either from context-menu click event or keyboard event. var sourceBmd:BitmapData = new…
eRez
  • 229
  • 6
  • 21
3
votes
1 answer

Local XSL reference within XML-File

First a short task description: There is an XML file which references a xsl stylesheet which is within a *.dll. The beginning of this XML looks as follows:
Vladimir S.
  • 420
  • 1
  • 10
  • 22
3
votes
2 answers

Flex FileReference prohibited characters

The use of FileReference has a constraint on valid characters. Error: Error #2087: The FileReference.download() file name contains prohibited characters. This is fine since I guess the restriction comes from the underlying file system anyway Is…
MonoThreaded
  • 9,824
  • 9
  • 63
  • 98
1
2 3
11 12