aspose file tools*
The moose likes Applets and the fly likes Uploading files without form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Uploading files without form" Watch "Uploading files without form" New topic
Author

Uploading files without form

Mike Phillip
Ranch Hand

Joined: Dec 05, 2007
Posts: 37
Hi, I'm doing a a project with Servlets and here's what I need:

I created an Applet for the client to select some files (images) and the applet will then do some image processing with the files (resize and other stuff), so can the images be uploaded.

Since my applet has the files full path, can I use Apache Commons to upload them? I mean, without a form, since I already got the names.

I do realise that Servlets can't upload without form dur to security isues, but I will use an Applet.

thanks
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Apache Commons has several products.

Are you talking about their fileupload project or their httpclient project... or both?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"Mike Dikta",

Please check your private messages.
Mike Phillip
Ranch Hand

Joined: Dec 05, 2007
Posts: 37
Originally posted by Ben Souther:
Apache Commons has several products.

Are you talking about their fileupload project or their httpclient project... or both?


could be both, Can I use the httpclient that way?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I don't know a lot about httpClient but, as for fileupload (on the server side), as long as you are sending your servlet a properly formatted multipart encoded form request, you should be able to use it.

If you'd like, I can move this to our Applets forum for you.
There are other considerations with applets (like the sandbox preventing you from accessing the file system without an altered security policy on the client's machine or a signed applet that prompts the user for permission to do this.) The folks who frequent the Applets forum might be able to give you better help in this regard.

Also, thanks for fixing your name.

-Ben
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Mike Phillip:


could be both, Can I use the httpclient that way?


At a glance, it looks like you can:
http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/methods/multipart/package-frame.html
Mike Phillip
Ranch Hand

Joined: Dec 05, 2007
Posts: 37
Originally posted by Ben Souther:
I don't know a lot about httpClient but, as for fileupload (on the server side), as long as you are sending your servlet a properly formatted multipart encoded form request, you should be able to use it.

If you'd like, I can move this to our Applets forum for you.
There are other considerations with applets (like the sandbox preventing you from accessing the file system without an altered security policy on the client's machine or a signed applet that prompts the user for permission to do this.) The folks who frequent the Applets forum might be able to give you better help in this regard.

Also, thanks for fixing your name.

-Ben


be my guest
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Uploading files without form