How to reset the file upload control in Angular JS
<p>In my app I have a file upload control , </p>

<pre><code>   &lt;label&gt;Upload File&lt;/label&gt;
    &lt;div class="ui-select"&gt;
            &lt;input type="file" name="files" ng-files="getTheFiles($files)" /&gt;
    &lt;/div&gt;
</code></pre>

<p>And the controller code that helps uploading files is ...</p>

<pre><code>    $scope.file = null;

    //UPLOAD FILE CODE
    var formdata;
    $scope.getTheFiles = function ($files) {
        console.log($files[0].type);
        formdata = new FormData();
        angular.forEach($files, function (value, key) {
            formdata.append(key, value);
        });
    };

    // NOW UPLOAD THE FILES.
    $scope.uploadFiles = function () {
        var request = {
            method: 'POST',
            url: BasePath + 'uploadNative/UploadFiles/',
            data: formdata,
            headers: {
                'Content-Type': undefined
            }
        };

        // SEND THE FILES.
        console.log(formdata);

        if (formdata != null || formdata != undefined) {
            $http(request)
                .success(function (response) {
                    if (response != "Failed!" &amp;&amp; response !="FileAlreadyUploaded") {
                        console.log("Succeeds");
                    }
                    else if(response == "FileAlreadyUploaded")
                    {
                        angular.element("#fileUploadModal").modal();

                    }
                    else {
                        console.log("Failed");
                    }
                })
                .error(function () {
                });
        }
</code></pre>

<p>I want the file upload control to be cleared up upon success or failure i.e. </p>

<p>after </p>

<pre><code>angular.element("#fileUploadModal").modal();
</code></pre>

<p>shows up the modal , I want the control to be cleared up . How would I do that ? Please explain.</p>