loki421
09-30-2009, 05:32 AM
Hi all,
I have a multi file upload that i have found on a tutorial website. I'm having a play and was trying to get the filename to MySQL so i can use it. So far i can reference the files name in a csv string built within the class, but my problem is getting that back to the main app so i can call a RemoteObject to send it to ColdFusion and on to the database so i can reference these uploaded files later on.
Here's what i've got inside the class:
private function uploadFiles(event:Event):void{
if (_files.length > 0){
_file = FileReference(_files.getItemAt(0));
_file.addEventListener(Event.OPEN, openHandler);
_file.addEventListener(ProgressEvent.PROGRESS, progressHandler);
_file.addEventListener(Event.COMPLETE, completeHandler);
_file.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityErrorHandler);
_file.addEventListener(HTTPStatusEvent.HTTP_STATUS,httpStatusHandler);
_file.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
_file.upload(_uploadURL);
setupCancelButton(true);
var FileNames:String = '';
for(var i:String in _files)
FileNames += _files[i].name + ',';
Alert.show(FileNames);// This will show my csv sting fine :)
}
So that's all well and good, but if i try to bind FileNames to my main app it tells me it can't find it.
I've tried
[Bindable]
public var FileNames:String;
at the top of the class and included it in my functions .as in the main app but it returns null.
Is there any other way of passing this csv string back to the main app?
Any pointers would be gratefully recived :D
Thanks in advance all!! :p
I have a multi file upload that i have found on a tutorial website. I'm having a play and was trying to get the filename to MySQL so i can use it. So far i can reference the files name in a csv string built within the class, but my problem is getting that back to the main app so i can call a RemoteObject to send it to ColdFusion and on to the database so i can reference these uploaded files later on.
Here's what i've got inside the class:
private function uploadFiles(event:Event):void{
if (_files.length > 0){
_file = FileReference(_files.getItemAt(0));
_file.addEventListener(Event.OPEN, openHandler);
_file.addEventListener(ProgressEvent.PROGRESS, progressHandler);
_file.addEventListener(Event.COMPLETE, completeHandler);
_file.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityErrorHandler);
_file.addEventListener(HTTPStatusEvent.HTTP_STATUS,httpStatusHandler);
_file.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler);
_file.upload(_uploadURL);
setupCancelButton(true);
var FileNames:String = '';
for(var i:String in _files)
FileNames += _files[i].name + ',';
Alert.show(FileNames);// This will show my csv sting fine :)
}
So that's all well and good, but if i try to bind FileNames to my main app it tells me it can't find it.
I've tried
[Bindable]
public var FileNames:String;
at the top of the class and included it in my functions .as in the main app but it returns null.
Is there any other way of passing this csv string back to the main app?
Any pointers would be gratefully recived :D
Thanks in advance all!! :p