• 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

problem with file upload in a JSF form

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all!

In a JSF form i have this code fragment.

<f:verbatim >
<input name="importFile" type="file" size="10">
</f:verbatim >

To upload the selected file I use commons-fileupload-1.0.jar from tomcat's 5.0 server dir.

I get this exception:

the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded

JSF forms dont allow the attribute encType to be set.
I tried this and the hole aplication dont work.

Does any one know a solution for this problem?

Thanks in advance.
 
Author
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Berciu,

I recommend you look into using MyFaces (http://www.myfaces.org/). MyFaces has a component for file uploads.

-James
JSF Resources and Console GUI tool
http://www.jamesholmes.com/JavaServerFaces/
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic