1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
   | $('#submit_btn').click(function (){
	//alert("toto");
	var myURL = "http://example.app.com/content-rest/contents/app_domain";
	alert(myURL);
	var video = document.getElementById("uploadFile");
        var vfile = video.files[0];
	alert(vfile.name);
	alert(vfile.size);
	$.ajax({
		type : "POST",
		dataType : "json",
		async: true,
		url : myURL,
		contentType: "multipart/form-data",
		//enctype: 'multipart/form-data',
		data : {	
			files : vfile
		},
		success : function(data) {
			alert("toto");
			alert(data);
		},
		error : function(jqXHR, textStatus, errorThrown) {
			alert("error sur fct ajax");
			alert(textStatus);
			alert(errorThrown);
		}
	});
}); | 
Partager