all groups > macromedia flash flash remoting > october 2005 >
You're in the

macromedia flash flash remoting

group:

File upload via remoting (AMFPHP)?


File upload via remoting (AMFPHP)? elderone
10/20/2005 12:42:14 PM
macromedia flash flash remoting:
Hi!

Re: File upload via remoting (AMFPHP)? kahanamaka
10/21/2005 6:32:47 PM
I dont think there is a consistent way to do file upload through flash. I
usually just open a new window from flash using javascript in your getURL to
pass whatever variables you need. you can run an interval in your flash movie
to be a listener, then set a variable back in flash using javascript from the
window you opened, such as:

window.opener.document.test.SetVariable('_global.varNewImage', 'true');

or whatever you want to set. works pretty well.


Re: File upload via remoting (AMFPHP)? elderone
10/26/2005 12:00:00 AM
Originally posted by: kahanamaka
I dont think there is a consistent way to do file upload through flash. I
usually just open a new window from flash using javascript in your getURL to
pass whatever variables you need. you can run an interval in your flash movie
to be a listener, then set a variable back in flash using javascript from the
window you opened, such as:

window.opener.document.test.SetVariable('_global.varNewImage', 'true');

or whatever you want to set. works pretty well.



No no no!
I ment real upload with Flash 8 and remoting components.
Re: File upload via remoting (AMFPHP)? mae ling
6/9/2006 12:54:03 PM
Hi,

you should use the FileReference class. Easy way to up and download file(s).
Here's what I found in Adobe docs , all the listeners for errors are also
included :

import flash.net.FileReference;
var allTypes:Array = new Array();
var imageTypes:Object = new Object();
imageTypes.description = "Images (*.jpg, *.jpeg, *.gif, *.png)";
imageTypes.extension = "*.jpg; *.jpeg; *.gif; *.png";
allTypes.push(imageTypes);
var listener:Object = new Object();
listener.onSelect = function(file:FileReference):Void {
trace("onSelect: " + file.name);
if(!file.upload("http://www.yourdomain.com/
yourUploadHandlerScript.cfm")) {
trace("Upload dialog failed to open.");
}
}
listener.onCancel = function(file:FileReference):Void {
trace("onCancel");
}
FileReference (flash.net.FileReference) 583
listener.onOpen = function(file:FileReference):Void {
trace("onOpen: " + file.name);
}
listener.onProgress = function(file:FileReference, bytesLoaded:Number,
bytesTotal:Number):Void {
trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " +
bytesTotal);
}
listener.onComplete = function(file:FileReference):Void {
trace("onComplete: " + file.name);
}
listener.onHTTPError = function(file:FileReference):Void {
trace("onHTTPError: " + file.name);
}
listener.onIOError = function(file:FileReference):Void {
trace("onIOError: " + file.name);
}
listener.onSecurityError = function(file:FileReference,
errorString:String):Void {
trace("onSecurityError: " + file.name + " errorString: " + errorString);
}
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
fileRef.browse(allTypes);


Hope this helps ;)
Re: File upload via remoting (AMFPHP)? mae ling
6/9/2006 12:54:59 PM
Hi,

you should use the FileReference class. Easy way to up and download file(s).
Here's what I found in Adobe docs :

import flash.net.FileReference;
var allTypes:Array = new Array();
var imageTypes:Object = new Object();
imageTypes.description = "Images (*.jpg, *.jpeg, *.gif, *.png)";
imageTypes.extension = "*.jpg; *.jpeg; *.gif; *.png";
allTypes.push(imageTypes);
var listener:Object = new Object();
listener.onSelect = function(file:FileReference):Void {
trace("onSelect: " + file.name);
if(!file.upload("http://www.yourdomain.com/
yourUploadHandlerScript.cfm")) {
trace("Upload dialog failed to open.");
}
}
listener.onCancel = function(file:FileReference):Void {
trace("onCancel");
}
FileReference (flash.net.FileReference) 583
listener.onOpen = function(file:FileReference):Void {
trace("onOpen: " + file.name);
}
listener.onProgress = function(file:FileReference, bytesLoaded:Number,
bytesTotal:Number):Void {
trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " +
bytesTotal);
}
listener.onComplete = function(file:FileReference):Void {
trace("onComplete: " + file.name);
}
listener.onHTTPError = function(file:FileReference):Void {
trace("onHTTPError: " + file.name);
}
listener.onIOError = function(file:FileReference):Void {
trace("onIOError: " + file.name);
}
listener.onSecurityError = function(file:FileReference,
errorString:String):Void {
trace("onSecurityError: " + file.name + " errorString: " + errorString);
}
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
fileRef.browse(allTypes);


Hope this helps ;)
AddThis Social Bookmark Button