在瀏覽器的差異應該不會影響到服務器端上傳。在打電話給服務器時,應該仔細檢查是否有該文件。
我假設你沒有使用自己的文件上傳按鈕。嘗試按照他們的HTML上傳指南,它應該工作,雖然我還沒有在Safari中測試過。
$scope.upload = function (file) {
console.log(file.length); // if less than 1 or undefined, then your problem is probably in the html. I
Upload.upload({
url: 'upload/url',
data: {file: file, 'username': $scope.username}
}).then(function (resp) {
console.log('Success ' + resp.config.data.file.name + 'uploaded. Response: ' + resp.data);
}, function (resp) {
console.log('Error status: ' + resp.status);
}, function (evt) {
var progressPercentage = parseInt(100.0 * evt.loaded/evt.total);
console.log('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);
});
};
我想它已經,但問題仍然存在。 –