Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2006, 06:23 AM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with FileUpload and request Parameters

i'm using FileUpload to upload a file in my aplication, like this:

<form name=datos method="post" enctype='multipart/form-data' action="/Juez/Juez/RecogerArchivo">

my problem is that i want to recieve some data about the user, name, and other parameters, like this (in the form)

<input type="text" name="nombre">
<input type="text" name="apellidos">

but in my servlet, when i do

  request.getParameter("nombre");

return null. this is because i'm using multipart/form-data, isn't it?

how can i resolve it?

thx!

P.D: excuse for my poor english

 
Old July 22nd, 2006, 09:32 PM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You're correct that you cannot read these properties because you're using multipart/form-data. In order to read these parameters, you have to have a special handler. Fortunately, there's many already available on the web. I recommend Apache Commons FileUpload (http://jakarta.apache.org/commons/fileupload/). I also use it for my own projects :).

Jon Emerson
http://www.jonemerson.net/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem to implement CSSClas on fileupload control azizur123 ASP.NET 2.0 Professional 1 October 13th, 2008 09:50 AM
Wierd asp:FileUpload problem rstelma ASP.NET 2.0 Professional 4 July 12th, 2008 05:31 AM
Problem with request.form. shankar_v1983 ASP.NET 2.0 Basics 1 January 28th, 2006 10:15 AM
How to get request parameters on client-side arcuza XSLT 6 March 22nd, 2005 09:13 AM
Problem with Request.QueryString mg1966 Classic ASP Databases 4 January 7th, 2005 02:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.