Jump to content

fileupload using jsps


santhosh kumar

Recommended Posts

an appilication of ours uses an old forum management system.. if we go to the post message page, we have no option to attach file.. am trying to give attach file provision.. the form for post messages contains similar elements that are seen when you try to post in this w3schools forum.. the problem is for file upload, the form should have "enctype=multipart/form-data".. but my code shows error saying "Posted content type isn't multipart/form-data ".. so when shld or when shldn i use "enctype=multipart/form-data".. ?..can someone clear my doubts..

Link to comment
Share on other sites

You need to use that whenever you have a file upload. You can probably use it even if you aren't uploading a file, but if you want to use file uploads you need to use it, or the upload won't be received. You put that attribute on the form tag:<form enctype="multipart/form-data" ... >

Link to comment
Share on other sites

ya.. i got that.. i wrote a separate jsp code (the form has the attribute enctype="multipart..") to upload a file and its working.. but when i use the the same coding in my existing code base (which is a form to post a message to a thread in a forum..) it is giving errors.. i belive the error could be in 'action' attribute.. in my code base the form is self submitting.. i am not sure how to make file upload work in aself submitting jsp..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...