<https://lh3.googleusercontent.com/-Ohi3Odcx6WA/VqqRlG2m5WI/AAAAAAAAADA/p1-xqm34wNU/s1600/fileupload.PNG>
Enter code here...
<html ng-app="app">
<body ng-controller="FileUploadCtrl">
<script src="~/Scripts/angular-file-upload.min.js"></script>
<script src="~/Scripts/angular.js"></script>
<script src="~/Scripts/controllers.js"></script>
<div class="row">
<label for="fileToUpload">Select a File to Upload</label><br />
<input type="file" ng-model-instant id="fileToUpload" multiple
onchange="angular.element(this).scope().setFiles(this)" />
</div>
@*<div id="dropbox" class="dropbox"
ng-class="dropClass"><span>{{dropText}}</span></div>*@
<div ng-show="files.length">
<div ng-repeat="file in files.slice(0)">
<span>{{file.webkitRelativePath || file.name}}</span>
(<span ng-switch="file.size > 1024*1024">
<span ng-switch-when="true">{{file.size / 1024 / 1024 |
number:2}} MB</span>
<span ng-switch-default>{{file.size / 1024 | number:2}}
kB</span>
</span>)
</div>
<input type="button" ng-click="uploadFile()" value="Upload" />
<div ng-show="progressVisible">
<div class="percent">{{progress}}%</div>
<div class="progress-bar">
<div class="uploaded" ng-style="{'width':
progress+'%'}"></div>
</div>
</div>
</div>
</body>
</html>
i
I have a working MVC app, but trying to add in an image upload feature, the
image will get stored in SQL. Am new to Angular, have been trying to make
the button click to Load the image file do something. The html is located
in the Edit View cshtml,
It will generate the openfile dialog but the progress is wrong because its
still shown in the {{. Im hoping to be able to pass the file into the MVC
@Model.Photo1 variable within the Edit and save it. the SQL defines it as
a byte array. So if I have an image file called 23.png the goal is to
store it, and then after its saved on another page that is displaying the
image it simply references it out of the @Model in the html <img
style="width: 180px; height: 190px; vertical-align: middle"
src="@Model.Photo1" />
It seems the function is not being called, tried putting Alert("Within
method call"); but no alert is shown. So far, the open file dialog opens,
but from there am not sure how to make this work, thanks for any ideas
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.