summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Policinski <lpolicinski@gmail.com>2014-02-19 21:28:32 +0000
committerLuke Policinski <lpolicinski@gmail.com>2014-02-19 21:28:32 +0000
commitb01492fecd5019a09cd7b1265a9cef43fc42616f (patch)
tree990ee253e5ba96b4fafd56afbbc42686e11e056e
parent79a6d89bccf4c5d4ce934c88bc544988c47b8e98 (diff)
downloadnextcloud-server-b01492fecd5019a09cd7b1265a9cef43fc42616f.tar.gz
nextcloud-server-b01492fecd5019a09cd7b1265a9cef43fc42616f.zip
Feature Added : Ability to drag and drop in Chrome
-rw-r--r--apps/files/ajax/upload.php4
-rw-r--r--apps/files/js/filelist.js12
-rw-r--r--lib/private/files/view.php10
3 files changed, 13 insertions, 13 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index b2aa7a99200..d189386e051 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -107,12 +107,12 @@ $directory = '';
if (strpos($dir, '..') === false) {
$fileCount = count($files['name']);
for ($i = 0; $i < $fileCount; $i++) {
-
+
// Get the files directory
if(isset($_POST['file_directory']) === true) {
$directory = '/'.$_POST['file_directory'];
}
-
+
// $path needs to be normalized - this failed within drag'n'drop upload to a sub-folder
if (isset($_POST['resolution']) && $_POST['resolution']==='autorename') {
// append a number in brackets like 'filename (2).ext'
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 2631812c2e2..17846c23b72 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -936,7 +936,7 @@ $(document).ready(function() {
var file = result[0];
if (data.context && data.context.data('type') === 'dir') {
-
+
// update upload counter ui
var uploadtext = data.context.find('.uploadtext');
var currentUploads = parseInt(uploadtext.attr('currentUploads'));
@@ -962,12 +962,12 @@ $(document).ready(function() {
// only append new file if uploaded into the current folder
if (file.directory !== FileList.getCurrentDirectory()) {
-
+
file_directory = file.directory.replace('/','').replace(/\/$/, "").split('/');
-
+
if (file_directory.length == 1) {
file_directory = file_directory[0];
-
+
// Get the directory
if ($('tr[data-file="'+file_directory+'"]').length == 0)
{
@@ -977,13 +977,13 @@ $(document).ready(function() {
else {
file_directory = file_directory[0];
}
-
+
// update folder size
var size = parseInt($('tr[data-file="'+file_directory+'"]').attr('data-size'));
size += parseInt(file.size);
$('tr[data-file="'+file_directory+'"]').attr('data-size', size);
$('tr[data-file="'+file_directory+'"]').find('td.filesize').text(humanFileSize(size));
-
+
return;
}
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 7977272ee1f..ddf8c3038be 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -617,21 +617,21 @@ class View {
}
public function fromTmpFile($tmpFile, $path) {
-
+
if (Filesystem::isValidPath($path)) {
-
+
// Get directory that the file is going into
$file_path = \OC_User::getHome(\OC_User::getUser()) . '/files'.substr($path, 0, strrpos($path,'/'));
-
+
// Create the directories if any
if(empty($file_path) === false) {
mkdir($file_path, 0770, true);
}
-
+
if (!$tmpFile) {
debug_print_backtrace();
}
-
+
$source = fopen($tmpFile, 'r');
if ($source) {
$this->file_put_contents($path, $source);