LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-10-2006, 10:52 AM
palsforpals palsforpals is offline
Registered User
 
Join Date: Apr 2006
Posts: 2
Rep Power: 0
palsforpals is on a distinguished road
Source How do I upload a file to JSP server using Flash

I want to create a Flash page which allows user to upload files. The scripting language for the server would be JSP using tomcat.

Can any tell me where I could find a tutorial in this matter, coz...I see php and flash interaction all around the net?? If some1 could post the code on JSP for doing this it would hep me completely, since I have already done the Flash 8 upload code as follows:

Code:
System.security.allowDomain("http://localhost", "127.0.0.1");
import flash.net.FileReference; 
var listener:Object = new Object();

listener.onSelect = function(selectedFile:FileReference):Void {
  statusArea.text += "Attempting to upload " + selectedFile.name + "\n";
  selectedFile.upload("http://localhost:8084/LoginTest/upload.jsp");
}; 
listener.onOpen = function(selectedFile:FileReference):Void {
  statusArea.text += "Uploading " + selectedFile.name + "\n";
}; 
listener.onHTTPError = function(file:FileReference, httpError:Number):Void {
	imagePane.contentPath = "error";
	imagePane.content.errorMSG.text = "HTTPError number: "+httpError +"\nFile: "+ file.name;
} 
listener.onIOError = function(file:FileReference):Void {
	imagePane.contentPath = "error";
	imagePane.content.errorMSG.text = "IOError: "+ file.name;
} 
listener.onSecurityError = function(file:FileReference, errorString:String):Void {
	imagePane.contentPath = "error";
	imagePane.content.errorMSG.text = "SecurityError: "+SecurityError+"\nFile: "+ file.name;	
} 
listener.onComplete = function(selectedFile:FileReference):Void {
  statusArea.text += "Upload finished.";
}; 
var imageFile:FileReference = new FileReference();
imageFile.addListener(listener); 

uploadBtn.onPress = uploadImage;
imagePane.addEventListener("complete", imageDownloaded);

function uploadImage(event:Object):Void {
  imageFile.browse([{description: "Bin Files", extension: "*.bin"}]);
}
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP: Preloading different swfs in same flash file.. Birdcaged Flash CS3 / Flash 9 5 12-05-2007 10:45 PM
Flash Encrypt protects action script sintrix.com New Softwares 4 08-08-2007 05:07 AM
How to upload flash files to remote server Bambee Flash MX 2004 4 12-13-2004 07:57 PM
Dynamic Text and Coding and stuff. Kainte Newbies 2 08-24-2003 11:18 PM




All times are GMT. The time now is 01:36 PM.