This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

FORM Question

 
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
 
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.
 
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.
 
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.
 
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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 ]
 
If somebody says you look familiar, tell them you are in porn. Or in these tiny ads:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!