Re: [flexcoders] File upload via JAVA

2007-01-25 Thread Abdul Qabiz

You can write simple servlet/jsp that does the uploading.

If you can write a simple app with html front end and java backend for file
uploading, you can transparently replace front-end with  Flash based
uploader. You have to take care of cases when multiple-files are being
uploaded together, on server-side you might need to check for that do the
appropriate.

-abdul



On 23 Jan 2007 20:29:28 -, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:



I'm trying to implement the file upload using the FileReference class and
can't find an example of the JAVA code that would be required, I've found
.net and php but no java, does anyone have an example ?

Cheers
Grant




Re: [flexcoders] File upload via JAVA ( jsp exemple)

2007-01-24 Thread azurs
correction
try {
upFile.upload(request,"upFile");// upFile.upload(request,"logoFile");  
upFile is the name use in the jsp page

} catch (error:Error) {

//trace("Unable to upload file.");
}


azurs a écrit :

> hello
> to implement java upload you need a jsp page in your application directory
> view this exemple
> --
> Upload.jsp
> <%@ page language="java"
> import="javazoom.upload.*,java.util.*,java.lang.*" %>
> <%@ page errorPage="ExceptionHandler.jsp" %>
> 
>  value="C:/fds2/jrun4/servers/default/samples/your_application/upload_directory"
>  
>
> />
> 
> 
> <%
>
> if (MultipartFormDataRequest.isMultipartFormData(request))
> {
>
> MultipartFormDataRequest mrequest = new
> MultipartFormDataRequest(request);
>
> Hashtable files = mrequest.getFiles();
> if ( (files != null) && (!files.isEmpty()) )
> {
> upBean.store(mrequest, "upFile");
>
> }
>
> }
> %>
>
> you need also the bean include in the zip file, put it in
> C:\fds2\jrun4\servers\default\samples\WEB-INF\lib\
>
> http://www.taguemount.fr/flex/WEB-INF.zip 
> 
>
> in your flex application use this code MXML
>
> private var upFile:FileReference = new FileReference();
>
> private function fileBrowse():void{
> var imageFilter:FileFilter = new FileFilter("Image Files
> (*.jpg, *.jpeg, *.gif, *.png, *.pdf)", "*.jpg; *.jpeg; *.gif; *.png;
> *.pdf");
>
>
> upFile.browse(new Array(imageFilter));
>
> }
> private function selectHandler(event:Event):void {
> var request:URLRequest = new
> URLRequest("http://localhost:8700/samples/your_application/Upload.jsp 
> ")
> request.method=URLRequestMethod.POST;
>
> try {
> upFile.upload(request,"logoFile");
> } catch (error:Error) {
>
> //trace("Unable to upload file.");
> }
> }
> private function completeHandler(event:Event):void {
>
> //trace("uploaded");
> }
>
> taguemount nacer
> http://www.taguemount.fr/ 
> [EMAIL PROTECTED] 
>
> [EMAIL PROTECTED]  a écrit :
>
> >I'm trying to implement the file upload using the FileReference class 
> and can't find an example of the JAVA code that would be required, 
> I've found .net and php but no java, does anyone have an example ?
> >
> >Cheers
> >Grant
> >
> >
> >
>
>  





[flexcoders] File upload via JAVA

2007-01-23 Thread [EMAIL PROTECTED]

I'm trying to implement the file upload using the FileReference class and can't 
find an example of the JAVA code that would be required, I've found .net and 
php but no java, does anyone have an example ?

Cheers
Grant