How to get the value submitted by formData? print formData is an empty object.

/ / upload files
uploadFiles = () = > {

// console.log(111)
this.field.validate();
let file1 = document.getElementById("file1");
const formData = new FormData();
formData.append("crowdName", this.state.inputVlaue);
formData.append("file", file1.files[0]);
console.log(formData.get("crowdName"))
console.log(formData)
if(!file1.files[0]){
  Toast.error("")
  return false;
}
console.log(file1.files[0])
Ajax.Fetch({
  type:"post",
  url:"/crowdUpload/updateCrowd.html",
  data:formData,
  success:(data) => {
    Toast.success("")
    console.log("")
    console.log(data)
    // location.href="customerGroup.html"
  }
})
  

}

Mar.29,2022

to get a single value, you can use the formData object. Get ();
but you can't see it when you print it directly. Because external access is not available, after you use the append method, the corresponding key-value pairs have been added to the form. What you see on the console is the FormData prototype , and the stored data is not reflected in the way of object properties.
you can try the following two methods to get it

 //
 for (var value of formData.values()) {
    console.log(value);
 }
 //
 for (var [a, b] of formData.entries()) {
    console.log(a, b);
 }      

if you have any questions, go to mdn for information
https://developer.mozilla.org...

.

Baidu formdata, all you see is putting formdata directly into the data of ajax, but the front end cannot print the data in this formdata object, so how should the back end take it?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ebfe6f-4884d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ebfe6f-4884d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?