tôi đọc này: https://github.com/enyo/dropzone/wiki/Set-URL-dynamically nhưng tôi không có thành công ... :( Tôi có 1 hình thức ...Làm cách nào để thay đổi url dropzone? URL động với thành công ajax
Và tôi gửi các đầu vào với ajax
Các ajax trả về. id mới của người dùng. trong thời điểm này tôi muốn thay đổi url vùng thả de cho thiết đường dẫn đến id của người dùng mới.
$.ajax({
type: "POST",
url: "class/inserir.php?funcao=teste",
data: formdata,
dataType: "json",
success: function(json){
if(json.sucesso=="sim"){
alert("Wait! Sending Pictures.");
this.options.url = "class/upload_img.php?"+json.id;
myDropzone.processQueue();
}else{
location.href="home.php?ir=cad_animal&cad=nao&erro="+json.erro;
}
}
});
var myDropzone = new Dropzone("#imagens", {
url: "class/upload_imgteste.php",
paramName: "file", // The name that will be used to transfer the file
maxFilesize: 1, // MB
addRemoveLinks : true,
dictResponseError: "Não foi possível enviar o arquivo!",
autoProcessQueue: false,
thumbnailWidth: 138,
thumbnailHeight: 120,
});
xin lỗi vì tiếng xấu của tôi!
Cảm ơn tất cả.