• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FORM Question

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic