FAQ
I have an html file field in my form. Basically to obtain input for certain
fields we have given user the option to either upload data through a file or
input it manually. Now I haven't set the enctype of the form in html form
tag but i set it using javascript whenever file input is selected.

But this doesn't work. It works only if i write <html:form action="/create"
enctype="multipart/form-data">

The reason why I want to set it using javascript is because in case the
manual input is large (about 400-500 values using indexed properties), my
application throws out of memory exception.

Any clues??


--
Puneet

Search Discussions

  • Puneet Lakhina at Oct 30, 2006 at 2:21 pm

    On 10/30/06, Puneet Lakhina wrote:
    I have an html file field in my form. Basically to obtain input for
    certain fields we have given user the option to either upload data through a
    file or input it manually. Now I haven't set the enctype of the form in html
    form tag but i set it using javascript whenever file input is selected.

    But this doesn't work. It works only if i write <html:form
    action="/create" enctype="multipart/form-data">

    The reason why I want to set it using javascript is because in case the
    manual input is large (about 400-500 values using indexed properties), my
    application throws out of memory exception.

    Any clues??


    --
    Puneet
    I removed the enctype from the form tag, and checked in my request processor
    what is the content type of the request, and as it turns out the enctype
    isnt getting set.

    I dont know where am i going wrong

    The follwing line gives an alert message multipart/form-data.

    <html:form action="/create" onsubmit="alert(this.enctype)">
    But in the request processor system.out.println(request.getContentType()). I
    still get application/x-www-form-urlencoded.

    Im guessing based on this that its not possible to set enctype using
    javascript. is that true?? im really confused at this point of time.


    --
    Puneet

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriesstruts
postedOct 30, '06 at 1:52p
activeOct 30, '06 at 2:21p
posts2
users1
websitestruts.apache.org
irc#struts

1 user in discussion

Puneet Lakhina: 2 posts

People

Translate

site design / logo © 2022 Grokbase