Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / June 2006



Tip: Looking for answers? Try searching our database.

File upload via remoting (AMFPHP)?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
elderone - 20 Oct 2005 13:42 GMT
Hi!

Is it possibe to upload file via remoting? Or somehow get back data about upload and image processing results.
kahanamaka - 21 Oct 2005 19:32 GMT
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.
elderone - 26 Oct 2005 16:52 GMT
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.
mae ling - 09 Jun 2006 13:54 GMT
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 ;)
mae ling - 09 Jun 2006 13:54 GMT
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 ;)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.