use post to delete files, get has a limit and fails with many files
This commit is contained in:
parent
518ca0ac58
commit
1b411df83e
|
@ -7,15 +7,15 @@ OCP\JSON::checkLoggedIn();
|
||||||
OCP\JSON::callCheck();
|
OCP\JSON::callCheck();
|
||||||
|
|
||||||
// Get data
|
// Get data
|
||||||
$dir = stripslashes($_GET["dir"]);
|
$dir = stripslashes($_POST["dir"]);
|
||||||
$files = isset($_GET["file"]) ? stripslashes($_GET["file"]) : stripslashes($_GET["files"]);
|
$files = isset($_POST["file"]) ? stripslashes($_POST["file"]) : stripslashes($_POST["files"]);
|
||||||
|
|
||||||
$files = explode(';', $files);
|
$files = explode(';', $files);
|
||||||
$filesWithError = '';
|
$filesWithError = '';
|
||||||
$success = true;
|
$success = true;
|
||||||
//Now delete
|
//Now delete
|
||||||
foreach($files as $file) {
|
foreach($files as $file) {
|
||||||
if( !OC_Files::delete( $dir, $file )) {
|
if( !OC_Files::delete( $dir, $file )) {
|
||||||
$filesWithError .= $file . "\n";
|
$filesWithError .= $file . "\n";
|
||||||
$success = false;
|
$success = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -276,6 +276,7 @@ var FileList={
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: OC.filePath('files', 'ajax', 'delete.php'),
|
url: OC.filePath('files', 'ajax', 'delete.php'),
|
||||||
async:!sync,
|
async:!sync,
|
||||||
|
type:'post',
|
||||||
data: {dir:$('#dir').val(),files:fileNames},
|
data: {dir:$('#dir').val(),files:fileNames},
|
||||||
complete: function(data){
|
complete: function(data){
|
||||||
boolOperationFinished(data, function(){
|
boolOperationFinished(data, function(){
|
||||||
|
|
Loading…
Reference in New Issue