T
T
Turtle_Onni2015-12-21 19:40:44
Angular
Turtle_Onni, 2015-12-21 19:40:44

Angular and webApi how to send file along with object?

Hello!
At the moment I have:

<div class="form-group">
            <div class="col-xs-12 col-sm-4">
                <select ng-model="doc.Type" class="form-control">
                    <option value="">--Тип--</option>
                    <option ng-repeat="typeDoc in typeOfDocs" value="{{typeDoc.title}}">{{typeDoc.title}}</option>
                </select>
            </div>
            <div class="col-xs-12 col-sm-6">
                <div class="form-inline">
                    <input type="file" file-uploader="myFile" class="form-control"/>
                    <button ng-click="uploadFile()" class="btn btn-default">Загрузить</button>
                </div>
            </div>
        </div>

Uploading a single file to the server works fine. But it became necessary for me to send not only the file, but also some fields from the page. Please throw off examples of this procedure or where it is possible to look. Thanks a lot.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2015-12-21
@miraage

https://github.com/danialfarid/ng-file-upload

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question