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 January 22nd, 2007, 11:24 PM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to myhrvod
Default how can i get input of file through servlet?

i write a jsp with <input type=file name=path>,but when i through servlet with request.getparameter("path"),the result is null, why,is anybody can tell me?

 
Old March 26th, 2007, 01:46 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

You can not use request.getParameter() method when you are trying to upload a file, if the form tag has file type input tag then the form's enctype attribute should be set like enctype="multipart/form-data", then only you'll be able to get the file content in servlet.

regards,
Rakesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
Invoking a batch file from servlet vinayreddy Servlets 3 October 24th, 2008 02:12 AM
Regards Servlet file run in server sureshsdckap Apache Tomcat 1 July 13th, 2007 03:34 PM
File Chooser in Servlet swaminathanb Java GUI 2 March 26th, 2007 11:49 PM
How Can I call a HTML file from a servlet? alf.guzman Servlets 3 January 24th, 2005 04:51 AM
Multiple file input single file output.... jdm_mboy Biztalk 1 July 2nd, 2003 03:35 AM





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