Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FORM Question

 
Ray Gear
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have this ftp webpage, where i want to pass some info (e.g. server name, username, password) and of cos the file to transfer.... but the problem i am not able to get the info of the server name, etc using getParameter(...) if i use multipart/form-data....
any idea how can i solve it??? very urgent
 
Lakshmi Dasari
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How are you handling file upload? Are you using any third party package like Orielly's file upload package? You will not be able to read the parameter values from the request object as they are encrypted in case of multipart/form-data for security reasons.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the format of a "multipart/form-data" POST is different than that of a "application/x-www-form-urlencoded" (what you get the rest of the time).

Some web containers (notably older versions of iPlanet) would corrupt a multi-part submission, and your parameters would not be retrieved.
 
Ray Gear
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am not using any 3rd party package. it's purely coding in java, using Socket and etc.
so which one should i use 'application/x-www-form-urlencoded' or 'multipart/form-data', if i want to use the input - the server name, username, password and send the file over to the ftp server.
 
rajesh kumar jhaver
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use oreilly package to upload the file to webserver, once it is uploaded, with the use ftp package you can transfer uploaded file onto the ftp server.
[ March 27, 2003: Message edited by: rajesh kumar jhaver ]
 
Ray Gear
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think i need to make it very clear... I am not able to use 3rd party package. everything has to be coded in purely java.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think i need to make it very clear... I am not able to use 3rd party package. everything has to be coded in purely java.

Well, that isn't very clear. The 3rd party packages that have been mentioned here are pure Java.
Is what you are really trying to say is that you must personally write all the code for some reason? That's quite different.
If that's the case, then you are going to need to figure out how to parse and deal with multi-part forms. Not very complicated, but not a trivial amount of code.
You can google for the format, or you can dissect the o'reilly classes to figure out how they did it.
hth,
bear
[ March 27, 2003: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic