Dropzone Plus
  • Introduction
  • Getting Started
  • How to submit data
    • With pure HTML
      • Send files with pure HTML
    • With JavaScript
      • Send files with JavaScript
  • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. How to submit data

With JavaScript

There are many ways to send data via JavasScript. This would be one of the easiest solutions:

<button onclick="submit()">Submit data</button>

<script>
  function submit() {
    let data = { name: 'Some name', someRandomData: 'some value' };
    fetch("https://plus.dropzone.dev/_p/{YOUR_PROJECT_ID}", {
      method: "POST",
      body: JSON.stringify(data),
      headers: { "Content-Type": "application/json" },
    });
  }
</script>

This encodes the data as JSON and sends it to Dropzone Plus. Please note that the Content-Type needs to be set appropriately for it to be recognized.

PreviousSend files with pure HTMLNextSend files with JavaScript

Last updated 3 years ago

Was this helpful?