why this code does not work ? how am I supposed to append additional data in formdata?
fd = new FormData();
fd.append("file_for_upload", file_blob_chunk);
fd.append("test", "testing");
fd.append("test2", original_file_name);
xhr = new XMLHttpRequest();
xhr.open("POST", "files/index/" + file_name + '/' + file_part, true);
xhr.send(fd);
when I debug it, I can see the array for 'file_for_upload', but not for 'test' or 'test2'.
basicly usually you will use $_FILES and then it should show array of file_for_upload. It works that way. but now I need to add another one such as original_file_name. but it does not show the other array.
Is it possible because I only have one form for file upload in the html page, and don't have the other two textbox form?
You will find those two in $_POST
. Only files go into $_FILES
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With