0

I have this form in my html code:

<form action="upload" id="upload-dropzone" class="dropzone">
    <input type="hidden" name="browser-path" id="browser-path" value="/">

    <div class="browser-buttons rrtl">
        <a id="browser-btn-upload">Upload</a>
    </div>

    <div class="lltr" id="browser-path-view"></div>
</form>

<script type="application/javascript">
    Dropzone.options.uploadDropzone = {
        clickable: "#browser-btn-upload",
    };
    loadBrowserContent();
</script>

As this document said, the hidden input field browser-path will automatically be submitted as POST data to server.

I have this code in my server side:

System.out.println(request.getParameter("browser-path"));

But this code always prints null to output!

How can I submit this hidden field to my server and how can I read it?

Edit:

Thanks to steeno, the form enctype is multipart/form-data so I have to read the fields from another way.

S.Yavari
  • 876
  • 8
  • 25

1 Answers1

1

I assume you use Java as backend language?

As mentioned in the following question: HttpServletRequest get JSON POST data the problem yould be the encoding of the post request. Maybe try to get the post data with getReader instead of getParameter.

Community
  • 1
  • 1
steeno
  • 96
  • 3