Skip to content

Commit

Permalink
Merge pull request #15 from scambra/delete-fixes
Browse files Browse the repository at this point in the history
use post to delete files, get has a limit and fails with many files
  • Loading branch information
DeepDiver1975 committed Sep 21, 2012
2 parents ac69974 + 1b411df commit d505563
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/files/ajax/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
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;
}
Expand Down
1 change: 1 addition & 0 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down

0 comments on commit d505563

Please sign in to comment.