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.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.