複数のファイルを選択できるフォームがあります。各ファイルをAJAX経由でサーバーに送信したいだけです(複数選択で選択)。
を使用してファイルを取得できます
document.getElementById('attachment_file').files
のようなものを使いたい
var files = document.getElementById("attachment_file").files
$.each(files, function(index, file11){
$.ajax({
url: "/users",
type: 'POST',
dataType: 'json',
data: {doc: {title: file11}},
async: false,
success: function() {
}
});
});
ここでは、ファイル パラメータを渡すことができません。任意の提案