Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Uploading files without form

 
Mike Phillip
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apache Commons has several products.

Are you talking about their fileupload project or their httpclient project... or both?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Mike Dikta",

Please check your private messages.
 
Mike Phillip
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic