JavaScript Error: Unexpected field. using uploadMultiple from dropzone.js error unexpected field multer,error unexpected field,error unexpected field

I wanted to have a way so users can choose images to send with a review.

so I use dropzone.js . It seems like having problems sending multiple images in one request. I thought that req.files would contain an array of files but that didn't happen. right now I see a problem because dropzone adds [] with the indexes inside for the name param.

when adding to images to dropzone I see something like this in request payload:

------WebKitFormBoundaryJOpGX6kWaoknKhIN
Content-Disposition: form-data; name="images[0]"; filename="data.png"
Content-Type: image/png


------WebKitFormBoundaryJOpGX6kWaoknKhIN
Content-Disposition: form-data; name="images[1]"; filename="loginButton.png"
Content-Type: image/png


------WebKitFormBoundaryJOpGX6kWaoknKhIN--

I feel like [0] and [1] is causing me problems

server:

app.post("/files" , upload.array("images"), (req, res) =>{
    console.log("hit here")
    console.log("req.file :", req.file)
    // console.log(req.body)
    console.log(req.files)
    res.send("ok")
})

simple multer: I had more complicated one before

var upload = multer({ dest: "./uploads" })

frontend:

<script src = "/dropzone.js"></script>
<script>
    $(function(){
        Dropzone.autoDiscover = false;
        var myDropZone = new Dropzone(".dropzone", {
            url : "/files",
            // uploadMultiple : true,

            autoProcessQueue : false,
             parallelUploads: 5,
            paramName: "images",
            uploadMultiple: true,
            init : function(){
                this.on("success", function(){
                    // alert("success")
                })
                this.on("sendingmultiple", function(){
                    console.log("SENDING MULTIPLE");
                })
                this.on("errormultiple", function(files, response){
                    console.log("ERROR");
                    console.log(response);
                    console.log(files);
                })
            } 
        })
            $("#skip, #login").on("click", function(e){
                myDropZone.processQueue();
            })
    })

</script>
<div class = "dropzone"></div>
   <div id = "skip"> skip </div>
   <div id = "login">login</div>

when I get rid of uploadMultiple: true, I get the images in the FS but it looks like multiple post request were made there is no req.files array with multiple images. I thought there would be

Answer:1

Trying to get post tags with wordpress API - api call is /wp-json/wp/v2/posts ourHTMLString += '<i class="fa fa-tags">"' + postsData[i].tags + '"</i>'; It is returning these values "...

Trying to get post tags with wordpress API - api call is /wp-json/wp/v2/posts ourHTMLString += '<i class="fa fa-tags">"' + postsData[i].tags + '"</i>'; It is returning these values "...

  1. post tags and categories for pages
  2. post tags wordpress
  3. post tags and categories for pages plugin
  4. post tags and categories for pages wordpress
  5. post_tags_meta_box
  6. post tags mod apk
  7. post tags facebook
  8. post tags reddit
  9. post tags css
  10. post tags seo
  11. post tags laravel
  12. post tags wp
  13. post tags jekyll
  14. post tag shortcode
  15. pos tags list
  16. pos tags nltk
  17. post tags html
  18. post tags widget wordpress
  19. post tags wordpress php
  20. post tags in php

I do not have access to the HTML of the pages (they are program-built dynamically). I do have access to the JS page it is linked to. For example I can do somethin like this and it works: window....

I do not have access to the HTML of the pages (they are program-built dynamically). I do have access to the JS page it is linked to. For example I can do somethin like this and it works: window....

I have a general question about Flow. I currently use React's prop-types library to define component prop types. These checks are stripped out of production code, so it's still possible for data ...

I have a general question about Flow. I currently use React's prop-types library to define component prop types. These checks are stripped out of production code, so it's still possible for data ...

  1. flow type annotations
  2. flow type annotations function

I'm trying to remove the white space between the iframe and div as I can. Initially there are a huge white space, but after adding in margin: 0px; to my iframe, div, and h1 for my div as well, the ...

I'm trying to remove the white space between the iframe and div as I can. Initially there are a huge white space, but after adding in margin: 0px; to my iframe, div, and h1 for my div as well, the ...

  1. remove white space in excel
  2. remove white space from image
  3. remove whitespace python
  4. remove whitespace from string
  5. remove white space from string in python
  6. remove white space javascript
  7. remove white space in word
  8. remove whitespace r
  9. remove white space sql
  10. remove white space from pdf
  11. remove whitespace online
  12. remove white space css
  13. remove whitespace java
  14. remove white space from string c#
  15. remove white space html
  16. remove white space from string in r
  17. remove white space latex
  18. remove whitespace from string java
  19. remove whitespace from string c++
  20. remove whitespace php