Flex URLLoader Upload - Determinate Progress Bar? - actionscript-3

My application asks the user to select files for upload using a FileReference / FileReferenceList. The client then compresses the File data and uses URLLoader to upload the contents of the file.
One problem with the URLLoader is that the progress event does not get triggered for uploads. How do I track the upload progress? I am unable to create a FileReference for the newly compressed ZIP ByteArray.
-- Sri

Given the situation of Flex / Flash APIs, the answer is "not possible"

Related

Load and Save JSON file react client-side only

I am building a simple editor-type application in react-redux, and I want to mimic the operation of downloading and uploading json files for saving and loading data - entirely client side. The server side does not need the data. Local storage may be too small, and it would be nice to provide the user the data in a portable file they could upload on a new machine. Is this even possible, and if so how?
Using a blob file.
You can set the content of a new file which is temp and local, then trigger a click event to download the file.
duplicate answer here and here

Upload ByteArray to server - With upload progress

Is it possible that I can upload a ByteArray and receive a ProgressEvent on the upload progress?
I have tried:
Using URLLoader, but then I realized that it only shows the progress for the download.
Using FileReference, but then I realized that FileReference.data is read only.
Is there any way I can do this?
The user records with their microphone, and the sound is then uploaded to the server. This is why it's a ByteArray and not a FileReference.
Did a bit of searching around and came on a couple other SO posts that seem to indicate it is not possible. If you're using AIR perhaps you could save the ByteArray to a file using FileStream then load that file into a File object and call upload() on it.
You can to this only via self programming.
make and uploader server side script java for ex. and send the progress percentage via socket
so flash sending file and receiving the progress data via socket.

Flash record sound locally

Using flex,As can we record sound from microphone and store locally and and upload later?? Is there any relevant links to this please indicate
Check this link for how to use the microphone to record and use FileReference to save the recording
It is possible to record audio using the Microphone API SAMPLE_DATA event. The data property of the event is a ByteArray with the audio data.
A web based Flash application could copy these data samples to a data structure in memory and prompt the user to save the data to a local file. An AIR application would be able to write the data to the file system or SQL database directly.
See the links below for accessing audio from the microphone in ActionScript:
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d1d.html
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Microphone.html
It may help to encode the data in a standardised format to help with reading and editing later (WAV or PCM). You may also want to use compression to reduce the file size for transmission (eg: Ogg Vorbis codec from Adobe).

Flex swf write to local file if given authorization by the end user

Is it possible to write to a local file 'example.txt' from a Flex swf? FileStream class is available in Adobe AIR, not in Flex. I want to write to from a swf,not AIR application.
I am developing a kiosk type application which has to log user interaction data to a text file on the machine.
Is there a code example for doing this?
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf6167e-7fff.html#WS2db454920e96a9e51e63e3d11c0bf6167e-7ff9
You can use FileReference to save a file with user confirmation. You can also use FileReference to load a file specified by the user. Or, you can use a SharedObject to save information without a dialog.

Is it possible to convert an XML file created in actionscript to a FileReference object?

I have a working s3 uploader in actionscript that uses the FileReference class so a user can browse for files to upload when he/she clicks on the upload button.
I have a web application and I want the user to have his/her configuration saved to s3 as an XML file when they hit the save button, so the "save" button will trigger the upload. However, i cant figure out a way to add the XML file to the FileReference variable I create. I was looking at the File class but that appears to be only usable in AIR.
Is it possible to create a FileReference object based off of an XML file that actionscript creates within the application without browsing for a file using FileReference.browse(); ?
Thanks
The answer to my original question is "no". According to this article by Mike Chambers, you cant.
It is apparently a sandbox issue so that a malicious flash program will not be able to do anything related to saving files without a users permission.