Angular JS File Upload and Laravel Backend
<p>I'm currently having problems with my file upload function together with other fields in angular. I tried to test my laravel function to save and upload file with other fields with POSTMAN and it worked. </p>

<p>However, upon trying it to work with Angular JS Form, it is giving me an error like this:</p>

<p><a href="https://i.stack.imgur.com/VypBq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VypBq.png" alt="enter image description here"></a></p>

<p>This is my angular js code for getting all input from form and passed it to laravel:</p>

<pre><code>  $scope.addAccount = function(obj) {
        if ($scope.transformForm.$valid &amp;&amp; $scope.netForm.$valid) {
            $scope.uploadAccountProf();
        //$state.go("detailed");
            DataFactory.AddAccount($scope.obj).then(function successCallback(response) {
                console.log("success");
                Materialize.toast('Account Saved!', 8000, 'greenbg rounded nobr');
                $state.go('detailed');
                }, function errorCallback(response) {
                console.log("Error");
            });
        }
        else{
            console.log("try again");
            Materialize.toast('Please fill out all required field.', 8000, 'redbg rounded nobr');
        }
</code></pre>

<p>The code below is the responsible for the upload file thingy:</p>

<pre><code> $scope.uploadAccountProf = function(roastSlidesUpload){
        var fileAccount = angular.element(document.querySelector('#accountProfile'));
        var fileCompliance = angular.element(document.querySelector('#fileUpload'));
        //console.log(myRoastSlide[0].files[0]);
        $scope.obj['accountProfile']=fileAccount[0].files[0];
        $scope.obj['fileUpload']=fileCompliance[0].files[0];
        console.log($scope.obj);
        var formData = new FormData();
        formData.append('file', $scope.obj);

        console.log("asd",formData);
        return $scope.obj;
  };
</code></pre>

<p>My form:</p>

<pre><code>&lt;form id="transformForm" name="transformForm" class="addingTransformation" novalidate&gt;
</code></pre>

<p>Below is my form for file upload only, not including the other textboxes:</p>

<pre><code>&lt;div class="row"&gt;
                            &lt;div class="file-field input-field col s12"&gt;
                                &lt;div class="btn"&gt;
                                    &lt;span&gt;File&lt;/span&gt;
                                    &lt;input id="accountProfile" type="file"&gt;
                                &lt;/div&gt;
                            &lt;div class="file-path-wrapper"&gt;
                                &lt;input id="acctProfile" class="file-path validate" placeholder="Accout Profile" type="text"&gt;
                            &lt;/div&gt;
                            &lt;/div&gt;
                        &lt;/div&gt;
</code></pre>

<p>My button:</p>

<pre><code>&lt;button class="btn waves-effect waves-light right submit allmargin" type="submit" name="action" ng-click="verifiedaccount()"&gt;Submit
            &lt;i class="material-icons right"&gt;send&lt;/i&gt;
        &lt;/button&gt;
</code></pre>

<p>Can someone help me? I've been trying to solve this for weeks and still can't figure out what's wrong, and why angular is returning that error to me. :(</p>