0
我使用ngImgCrop上傳圖像和裁剪。我想要保存 <img-crop image="myImage" result-image="myCroppedImage"></img-crop>
結果圖像到asp.net mvc C#中的文件夾。 怎麼辦?保存圖像crope結果在角2
我使用ngImgCrop上傳圖像和裁剪。我想要保存 <img-crop image="myImage" result-image="myCroppedImage"></img-crop>
結果圖像到asp.net mvc C#中的文件夾。 怎麼辦?保存圖像crope結果在角2
:
$scope.upload = function (dataUrl, name) {
Upload.upload({
url: 'http://meminfo.hamotaghieman.ir/api/Upload/user/PostUserImage',
data: {
file: Upload.dataUrltoBlob(dataUrl, name)
},
}).then(function (response) {
$timeout(function() {
$scope.result = response.data;
});
}, function (response) {
if (response.status > 0) $scope.errorMsg = response.status
+ ': ' + response.data;
}, function (evt) {
$scope.progress = parseInt(100.0 * evt.loaded/evt.total);
});
}
和CSHTML文件:
<form name="form" class="col-sm-12">
آپلود فایل
<button class="btn btn-danger col-lg-push-4 col-xs-8"
placeholder="upload"
type="file" name="file"
ngf-select="onChangePackageApk($files)" ng-model="file" accept=".apk"
ngf-accept="'.apk'" ngf-max-size="10MB" required ngf-model-invalid="errorFile">
انتخاب فایل
</button>
<br />
<br />
<div class="row" style="background-color:red">
<button class="btn btn-success" type="submit" ng-click="submit()">ارسال</button>
</div>
<div style="width:{{progress}}%" ng-bind="progress + '%'"></div>
<div ng-bind="message">شماره تماس 09180 511 75 30</div>
<div>شماره تماس 09180 511 75 30</div>
</form>
<div class="wow animation-element c2 form-group" data-wow-duration="3s">
<label for="usr">نام:</label>
<input type="text" class="form-control" ng-model="message" id="usr" />
<label for="usrr">نام کاربری:</label>
<input type="text" class="form-control" ng-model="message" id="usrr" />
</div>