pqina / filepond-server-php

A PHP server that handles FilePond uploads
51 stars 16 forks source link

Remove temp file after submit #4

Open Ivamps opened 5 years ago

Ivamps commented 5 years ago

I'm using the server php and the sumit.php purposed with following code:

html:

js to process this button: $scope.addPEDFile = function(isValid) { console.log('$scope.pond', $scope.pond); if (isValid){ $scope.arquivos = $scope.pond.getFiles(); $http({ method : 'POST', url : 'api/filepond/submit.php', processData: false, transformRequest: function (data) { var formData = new FormData(); formData.append("filepond[]", $scope.arquivos[0].file, $scope.arquivos[0].file.name);
return formData;
}, headers: { 'Content-Type': undefined } }) $scope.pond.removeFile($scope.arquivos[0].id); } }

Executing that button, the file inserted in the pond is copied from the TRANSFER_DIR to the UPLOAD_DIR and in the last line ($scope.pond.removeFile($scope.arquivos[0].id);) it was supposed to clean the pond area and delete the TRANSFER_DIR copy of the file, but it only clean the pond area, the file still in the TRANSFER_DIR. Any idea how to solve it?

Ivamps commented 5 years ago

Html code:

      <form name="PEDFile" id="PEDFile" ng-submit="addPEDFile(PEDFile.$valid)">
        <input type="file" name="filepond[]" multiple>
        <button ng-disabled="PEDForm.$invalid" class="btn btn-default" type="submit">Send File</button>
      </form>
fcastilloma commented 4 years ago

Ivamps what you set like $scope ? I am trying to use your code to work on remove the TMP files.