angularjs $http file图片上传
 发布于 9 年前  作者 kezhi  11254 次预览  最后一次回复是 9 年前  来自 分享 
	$http({
					url: API_URL+'uploadimage',
					method: 'POST',
					headers: {
						'Content-Type': undefined
					},
					transformRequest: function() {
						var formData = new FormData();
						formData.append('file', $('#upfile')[0].files[0]);
						return formData;
					}
				}).success(function (data) {
					console.log(data);   //返回上传后所在的路径
				});