Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove temp file after submit #4

Open
Ivamps opened this issue Apr 2, 2019 · 2 comments
Open

Remove temp file after submit #4

Ivamps opened this issue Apr 2, 2019 · 2 comments

Comments

@Ivamps
Copy link

Ivamps commented Apr 2, 2019

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

html:



Send File

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
Copy link
Author

Ivamps commented Apr 2, 2019

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants