here's the actionscript file....on the root timeline i instantiate the class
like so...the uploadButton is just a button from the component
library...nothing to it right?
thanks
uploadBtn.addEventListener("click", uploadImage);
// When the user clicks the button Flash calls the uploadImage() function,
// and it opens a file browser dialog.
function uploadImage(event:Object):Void {
var uploader:FileUploader = new FileUploader();
uploader.UploadImage(event);
//imageFile.browse([{description: "Image Files", extension:
"*.jpg;*.gif;*.png"}]);
}
import flash.net.FileReference;
class app.data.FileUploader{
//VARS
private var Listener:Object;
private var UploadURL:String;
private var ImageFile:FileReference;
public function FileUploader()
{
Listener = new Object();
Listener.onSelect = function(selectedFile:FileReference):Void {
// Upload the file to the java server on the server.
//SetUploadURL("");
trace(selectedFile.name);
trace(selectedFile.size);
trace(selectedFile.type);
trace(selectedFile.name);
trace(selectedFile.modificationDate);
trace(selectedFile.creationDate);
var tempResult:Boolean =
selectedFile.upload("http://localhost:8082/ncaa/upload/fileUpload.jsp");
trace(tempResult);
};
Listener.onOpen = function(selectedFile:FileReference):Void {
};
Listener.onComplete = function(selectedFile:FileReference):Void {
trace("selected filename complete: "+selectedFile.name)
};
Listener.onHTTPError = function(file:FileReference,
httpError:Number):Void {
trace("onHTTPError: " + file.name);
trace("onHTTPError: " + httpError);
}
Listener.onIOError = function(file:FileReference):Void {
trace("onIOError: " + file.name);
};
Listener.onSecurityError = function(file:FileReference,
errorString:String):Void {
trace("onSecurityError: " + file.name + " errorString: " +
errorString);
};
ImageFile = new FileReference();
ImageFile.addListener(Listener);
}
public function SetUploadURL(url:String)
{
//TODO: pass in url and
UploadURL = "http://localhost:8082/ncaa/upload/fileUpload.jsp";
}
// If the image does not download, the event object's total property
// will equal -1. In that case, display a message to the user.
private function ImageDownloaded(event:Object):Void {
//TODO: attach to card movieclip
if(event.total == -1) {
trace("image downloaded: ");
}
}
private function DownloadImage(event:Object):Void {
//TODO: loadMovie....
trace("calling download image");
}
public function UploadImage(event:Object):Void
{
ImageFile.browse([{description: "Image Files", extension:
"*.jpg;*.gif;*.png"}]);
}
}
----- Original Message ----
From: Paul J DeCoursey <[EMAIL PROTECTED]>
To: Jakarta Commons Users List <[email protected]>
Sent: Thursday, January 25, 2007 12:47:52 PM
Subject: Re: adding patch to jar
Send me your actionscript and/or fla files as well, I'd like to see if I
can reproduce the problem.
badi malik wrote:
> Hi Paul,
>
> hmmm, ok that makes sense...however, there's nothing in the fileitems list
> either...here's my full code listing which i should have posted
> earlier...pardon me for being so vague...
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]