I send the script to the php file using XMLHttpRequest and FormData. Actually, the question is, how can I send some other data like IDs along with the files?
const request = new XMLHttpRequest(); const formData = new FormData(); request.open('POST', 'composer/upload_photo.php'); formData.append('photo', file); request.send(formData);