2017-10-07 2 views
0

私はngImgCropを使って画像をアップロードし、その画像を切り出します。私は保存したい <img-crop image="myImage" result-image="myCroppedImage"></img-crop> asp.net mvc C#のフォルダに結果画像。 どうすればよいですか? ctrl.jsで画像を保存する2角膜の結果

答えて

0

$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> 
関連する問題