filereference

fileReference browse from js, simulate keypress in flash workaround

99封情书 提交于 2019-12-11 23:37:51
问题 I am trying to call fileReference.browse from outside the flash SWF, i read some articles that said normally it's imposible due to Flash 10 security stuff.. so i was wondering isnt it posible to send a command from js to flash which will simulate a keypress inside the flash, which (this keypress) will trigger the fileReference. Thank you in advance, Daniel! 回答1: It's impossible (it would create quite a serious security risk). You can confirm this by checking any uploader module out there that

Manipulate file data (byte array)

十年热恋 提交于 2019-12-11 15:31:20
问题 I'm totally new to ActionScript 3, though I'm a OOP coder. I've seen with this snippet that I can easily change bytes one by one. var j:int = myFile._fileRef.data.length; while (j--) { myfile._fileRef.data[j] += 128; } When I upload a file after applying a change to every byte, the results seems perfect. But when I'm trying to directly assign a new bytearray (an encoded one) to the data member of _fileRef, the compiler reminds me that it is read only. Is there an appropriate method to quickly

Flex Filereference automatically retry when failed (like error #2038)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 11:13:32
问题 Is there a way to automatically retry Fileupload.upload() opertaion if it fails with IO_Error? I tried calling upload() again (and it did reach all the way to the web-service) ==> but it did NOT trigger DataEvent.UPLOAD_COMPLETE_DATA when the Retry was completed (i checked with a sniffer that the retry operation did finish successfully) Thanks for any ideas. 来源: https://stackoverflow.com/questions/10471060/flex-filereference-automatically-retry-when-failed-like-error-2038

Flex 4 FileReference Issues With Firefox

梦想的初衷 提交于 2019-12-11 06:16:07
问题 I'm trying to perform a file upload using a FileReference from a Flex app running in Firefox 4. However when I attempt to call the upload() method, the Filereference throws an IOError with the following Error #2038: File I/O Error. URL: http://localhost:8080/admin/upload If I don't explicitly add a listener for the IOErrorEvent, then I get a Flash player popup stating SecurityError: Error #2000: No active security context. The request doens't even hit my server (I can verify by placing

Uploading data with Flex and getting the bytes sent

*爱你&永不变心* 提交于 2019-12-11 06:05:26
问题 I want to upload data (not a local file) with Flex (4.1), and show what the progress is of the bytes sent. Now I use a URLLoader, but I know that URLLoader was designed to download data, I can connect a listener to ProgressEvent.PROGRESS but that has no effect. I also know there is a FileReference object which supports uploading. The problem here is, I do not want to browse for a file and upload it. I have a byte array which I want to send to the server, but the data property of FileReference

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

我只是一个虾纸丫 提交于 2019-12-05 21:34:35
问题 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 I discussed with Jacob? End edit I'm saving an image from my AS3 app using FileReference.save(). This is the code, which works fine: var encoder:JPGEncoder = new JPGEncoder(80); var byteData = encoder.encode(myBMD); //bitmap data object created

How to remove reference of file Xcode?

微笑、不失礼 提交于 2019-12-05 02:40:57
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 reference nor the file had been removed). To make the long story short, my project tried using the reference to the old file, so I went through finder to delete the conflicting files. That solved the issue of which class was being reference. But the reference to the deleted files cause a warning in Xcode giving me a Missing File message. Does anyone know

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

痴心易碎 提交于 2019-12-04 04:13:04
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 I discussed with Jacob? End edit I'm saving an image from my AS3 app using FileReference.save(). This is the code, which works fine: var encoder:JPGEncoder = new JPGEncoder(80); var byteData = encoder.encode(myBMD); //bitmap data object created earlier var file:FileReference = new FileReference(); file.save(byteData, "myImage.jpg"); This opens up the

as3 Air for Android downloading and saving remote files

六月ゝ 毕业季﹏ 提交于 2019-12-03 20:35:22
The Code below downloads an mp3 to your phone from a server using as3 Air For Android. I want to use these files later in the app so I have the following question: How can I make it so the files save to a particular folder in the android app rather than a box opening for the user to choose a location? import flash.net.FileReference; /// It can be an mp3,jpg, png, etc... just change the url /// and the extension name. nice huh? var yourFileLocation = "http://YourWeb.com/YourSong.mp3"; var yourFileName = "YourSong.mp3"; var daFile:FileReference = new FileReference(); daFile.download(new

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

感情迁移 提交于 2019-11-27 14:05:52
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 Error exception." (from the documentation here ) This restriction is a bit vague. Does it mean that I can only call the FileReference.save() method from within an event handler function that is registered as a listener for certain types of user events? If so