GeeCON Prague 2014*
The moose likes JSP and the fly likes How to pass filename+contens as hidden fields to servlet from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "How to pass filename+contens as hidden fields to servlet from jsp" Watch "How to pass filename+contens as hidden fields to servlet from jsp" New topic
Author

How to pass filename+contens as hidden fields to servlet from jsp

Ravi Kumar
Greenhorn

Joined: Aug 28, 2008
Posts: 18
Hi,

I have declared the browse file declaration as below

<form name frm2>
<input class="BrowseFile" name="filename" onchange="addAttachment();" onkeypress="return uploadAttachmentOnEnter()" type="file">
</form>

Now i want to pass this "filename" as hidden to servlet from jsp with contents. I have declared a hidden variable in jsp and try to assign the "filename" to that variable it is passing only filename but not contents available inside the file.

Please suggest me how to pass the filename+contents to servlet from jsp.

Thanks
Ravi Kumar. A
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
You could use

However, there are restrictions. You will only get a hold of the filename, not the filepath. This is somewhat in terms of confidentiality. I wouldn't want everybody to know about my directory structure.


JDBCSupport - An easy to use, light-weight JDBC framework -
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

See the JSP FAQ.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to pass filename+contens as hidden fields to servlet from jsp