Merge pull request #15 from scambra/delete-fixes
use post to delete files, get has a limit and fails with many files
This commit is contained in:
commit
d5055639b2
2 changed files with 4 additions and 3 deletions
|
@ -7,15 +7,15 @@ OCP\JSON::checkLoggedIn();
|
|||
OCP\JSON::callCheck();
|
||||
|
||||
// Get data
|
||||
$dir = stripslashes($_GET["dir"]);
|
||||
$files = isset($_GET["file"]) ? stripslashes($_GET["file"]) : stripslashes($_GET["files"]);
|
||||
$dir = stripslashes($_POST["dir"]);
|
||||
$files = isset($_POST["file"]) ? stripslashes($_POST["file"]) : stripslashes($_POST["files"]);
|
||||
|
||||
$files = explode(';', $files);
|
||||
$filesWithError = '';
|
||||
$success = true;
|
||||
//Now delete
|
||||
foreach($files as $file) {
|
||||
if( !OC_Files::delete( $dir, $file )) {
|
||||
if( !OC_Files::delete( $dir, $file )) {
|
||||
$filesWithError .= $file . "\n";
|
||||
$success = false;
|
||||
}
|
||||
|
|
|
@ -281,6 +281,7 @@ var FileList={
|
|||
$.ajax({
|
||||
url: OC.filePath('files', 'ajax', 'delete.php'),
|
||||
async:!sync,
|
||||
type:'post',
|
||||
data: {dir:$('#dir').val(),files:fileNames},
|
||||
complete: function(data){
|
||||
boolOperationFinished(data, function(){
|
||||
|
|
Loading…
Reference in a new issue