This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes Creating a Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSP
Bookmark "Creating a "BROWSE" button on JSP Page" Watch "Creating a "BROWSE" button on JSP Page" New topic

Creating a "BROWSE" button on JSP Page

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1114
This is probably simple, but I can't find it in my books.

How do you create a "browse" button on a JSP page that lets the user select a file from his local file system?

Thanks in advance.

-- Mike
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

<input type="file" ....

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

If you need the form to work, see file upload forms

I always forget the enctype attribute in forms that have file uploads:
the form tag must have:
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1114
Thanks all!!!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Creating a "BROWSE" button on JSP Page
It's not a secret anymore!