Fabrice,

Are you using The Upload Service provided by Turbine?  I've been working
with it for the last week and have had no problems.  It takes a lot of the
leg work out of using file uploads (props out to the Turbine Team!).  Could
you describe in a little more detail how you are approaching uploading
files?

Scott




> -----Original Message-----
> From: Fabrice Morisseau [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 12, 2002 11:50 AM
> To: [EMAIL PROTECTED]
> Subject: Upload Service
> 
> 
> Arrggg, i need help ;-)
> I am trying to do an Upload file server with file send by a 
> java program.
> The upload action now extends VelocityAction instead of  
> SecureAction in 
> order to avoid any authentification.
> 
> Problem is that doUpdate is never call.
> 
> Thanks
> Fabrice
> 
> 
> Client looks like this :
> 
> protected final static String BOUNDARY = 
> "---------------------------7d159c1302d0y0";
> ...
>         URL url = new 
> URL("http://192.168.0.3:8080/NetyrinthWS/servlet/NetyrinthWS/a
> ction/Upload");
>         HttpURLConnection connection = (HttpURLConnection) 
> url.openConnection();
>         connection.setRequestMethod("POST");
>         connection.setRequestProperty("Content-type", 
> "multipart/form-data; boundary=" + BOUNDARY);
>         connection.setDoOutput(true);
>         connection.setDoInput(true);
>         OutputStream out = connection.getOutputStream();
>         InputStream in = connection.getInputStream();
>       
>         // Write File    
>         writeln(out,"--" + BOUNDARY);
>         writeFileToURL(out,file);
>         writeln(out,"--" + BOUNDARY);
>         writeln(out,"Content-Disposition: form-data; 
> name=\"eventSubmit_doUpload\"");
>         writeln(out,"Upload");
>         writeln(out,"--" + BOUNDARY+"--");
>         out.flush();
>         out.close();
> ...
> 
> and give the following generated content
> 
> 
> -----------------------------7d159c1302d0y0
> Content-Disposition: form-data; name="file"; 
> filename="s1013531585912_1303096536.log"
> Content-Type: application/octet-stream
> Content of my file
> -----------------------------7d159c1302d0y0
> Content-Disposition: form-data; name="eventSubmit_doUpload"
> Upload
> -----------------------------7d159c1302d0y0--
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

Reply via email to