aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-09-23 10:39:12 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-09-23 10:39:12 +0200
commitf6e8a388a90fff82c16589cf09911ef3aeb4005d (patch)
treea47f16ed41fa3b884a4d709ef09136a4d0c785d0 /apps/files
parent82cbbb8ab8cfe81559c45905d7fca819d71df346 (diff)
parent9851f0f4f2a97dc6ac1382bcd533eb23feffa4e0 (diff)
downloadnextcloud-server-f6e8a388a90fff82c16589cf09911ef3aeb4005d.tar.gz
nextcloud-server-f6e8a388a90fff82c16589cf09911ef3aeb4005d.zip
Merge branch 'master' into encryption_improved_error_messages_4617
Conflicts: settings/ajax/changepassword.php
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/ajax/delete.php2
-rw-r--r--apps/files/ajax/getstoragestats.php2
-rw-r--r--apps/files/ajax/list.php6
-rw-r--r--apps/files/ajax/rawlist.php6
-rw-r--r--apps/files/ajax/upload.php68
-rw-r--r--apps/files/appinfo/app.php1
-rw-r--r--apps/files/appinfo/register_command.php9
-rw-r--r--apps/files/command/scan.php73
-rw-r--r--apps/files/console/scan.php31
-rw-r--r--apps/files/css/files.css4
-rw-r--r--apps/files/css/upload.css119
-rw-r--r--apps/files/index.php7
-rw-r--r--apps/files/js/file-upload.js557
-rw-r--r--apps/files/js/fileactions.js7
-rw-r--r--apps/files/js/filelist.js268
-rw-r--r--apps/files/js/files.js67
-rw-r--r--apps/files/js/jquery.fileupload.js1023
-rw-r--r--apps/files/js/jquery.iframe-transport.js70
-rw-r--r--apps/files/l10n/ach.php7
-rw-r--r--apps/files/l10n/af_ZA.php7
-rw-r--r--apps/files/l10n/ar.php3
-rw-r--r--apps/files/l10n/be.php7
-rw-r--r--apps/files/l10n/bg_BG.php1
-rw-r--r--apps/files/l10n/bn_BD.php1
-rw-r--r--apps/files/l10n/bs.php12
-rw-r--r--apps/files/l10n/ca.php3
-rw-r--r--apps/files/l10n/cs_CZ.php3
-rw-r--r--apps/files/l10n/cy_GB.php3
-rw-r--r--apps/files/l10n/da.php3
-rw-r--r--apps/files/l10n/de.php8
-rw-r--r--apps/files/l10n/de_AT.php7
-rw-r--r--apps/files/l10n/de_CH.php74
-rw-r--r--apps/files/l10n/de_DE.php8
-rw-r--r--apps/files/l10n/el.php3
-rw-r--r--apps/files/l10n/en_GB.php75
-rw-r--r--apps/files/l10n/eo.php3
-rw-r--r--apps/files/l10n/es.php3
-rw-r--r--apps/files/l10n/es_AR.php3
-rw-r--r--apps/files/l10n/es_MX.php7
-rw-r--r--apps/files/l10n/et_EE.php3
-rw-r--r--apps/files/l10n/eu.php3
-rw-r--r--apps/files/l10n/fa.php3
-rw-r--r--apps/files/l10n/fi_FI.php5
-rw-r--r--apps/files/l10n/fr.php3
-rw-r--r--apps/files/l10n/gl.php3
-rw-r--r--apps/files/l10n/he.php3
-rw-r--r--apps/files/l10n/hi.php1
-rw-r--r--apps/files/l10n/hr.php2
-rw-r--r--apps/files/l10n/hu_HU.php3
-rw-r--r--apps/files/l10n/id.php2
-rw-r--r--apps/files/l10n/is.php1
-rw-r--r--apps/files/l10n/it.php8
-rw-r--r--apps/files/l10n/ja_JP.php3
-rw-r--r--apps/files/l10n/ka_GE.php3
-rw-r--r--apps/files/l10n/km.php7
-rw-r--r--apps/files/l10n/kn.php7
-rw-r--r--apps/files/l10n/ko.php3
-rw-r--r--apps/files/l10n/lb.php1
-rw-r--r--apps/files/l10n/lt_LT.php3
-rw-r--r--apps/files/l10n/lv.php3
-rw-r--r--apps/files/l10n/mk.php1
-rw-r--r--apps/files/l10n/ml_IN.php7
-rw-r--r--apps/files/l10n/ms_MY.php1
-rw-r--r--apps/files/l10n/nb_NO.php3
-rw-r--r--apps/files/l10n/ne.php7
-rw-r--r--apps/files/l10n/nl.php3
-rw-r--r--apps/files/l10n/nn_NO.php3
-rw-r--r--apps/files/l10n/nqo.php7
-rw-r--r--apps/files/l10n/oc.php2
-rw-r--r--apps/files/l10n/pa.php16
-rw-r--r--apps/files/l10n/pl.php3
-rw-r--r--apps/files/l10n/pt_BR.php8
-rw-r--r--apps/files/l10n/pt_PT.php3
-rw-r--r--apps/files/l10n/ro.php15
-rw-r--r--apps/files/l10n/ru.php10
-rw-r--r--apps/files/l10n/si_LK.php1
-rw-r--r--apps/files/l10n/sk.php7
-rw-r--r--apps/files/l10n/sk_SK.php3
-rw-r--r--apps/files/l10n/sl.php3
-rw-r--r--apps/files/l10n/sq.php3
-rw-r--r--apps/files/l10n/sr.php3
-rw-r--r--apps/files/l10n/sr@latin.php3
-rw-r--r--apps/files/l10n/sv.php3
-rw-r--r--apps/files/l10n/sw_KE.php7
-rw-r--r--apps/files/l10n/ta_LK.php2
-rw-r--r--apps/files/l10n/th_TH.php3
-rw-r--r--apps/files/l10n/tr.php3
-rw-r--r--apps/files/l10n/ug.php1
-rw-r--r--apps/files/l10n/uk.php3
-rw-r--r--apps/files/l10n/vi.php3
-rw-r--r--apps/files/l10n/zh_CN.php3
-rw-r--r--apps/files/l10n/zh_TW.php3
-rw-r--r--apps/files/lib/helper.php6
-rw-r--r--apps/files/templates/fileexists.html26
94 files changed, 2013 insertions, 793 deletions
diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php
index 5f4856ec790..c69f5a8860c 100644
--- a/apps/files/ajax/delete.php
+++ b/apps/files/ajax/delete.php
@@ -24,7 +24,7 @@ foreach ($files as $file) {
}
// get array with updated storage stats (e.g. max file size) after upload
-$storageStats = \OCA\files\lib\Helper::buildFileStorageStatistics($dir);
+$storageStats = \OCA\Files\Helper::buildFileStorageStatistics($dir);
if ($success) {
OCP\JSON::success(array("data" => array_merge(array("dir" => $dir, "files" => $files), $storageStats)));
diff --git a/apps/files/ajax/getstoragestats.php b/apps/files/ajax/getstoragestats.php
index 7a2b642a9bd..32a77bff6c3 100644
--- a/apps/files/ajax/getstoragestats.php
+++ b/apps/files/ajax/getstoragestats.php
@@ -6,4 +6,4 @@ $RUNTIME_APPTYPES = array('filesystem');
OCP\JSON::checkLoggedIn();
// send back json
-OCP\JSON::success(array('data' => \OCA\files\lib\Helper::buildFileStorageStatistics('/')));
+OCP\JSON::success(array('data' => \OCA\Files\Helper::buildFileStorageStatistics('/')));
diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php
index f1b713b5534..350fc7fa5f6 100644
--- a/apps/files/ajax/list.php
+++ b/apps/files/ajax/list.php
@@ -20,11 +20,11 @@ $doBreadcrumb = isset($_GET['breadcrumb']);
$data = array();
$baseUrl = OCP\Util::linkTo('files', 'index.php') . '?dir=';
-$permissions = \OCA\files\lib\Helper::getDirPermissions($dir);
+$permissions = \OCA\Files\Helper::getDirPermissions($dir);
// Make breadcrumb
if($doBreadcrumb) {
- $breadcrumb = \OCA\files\lib\Helper::makeBreadcrumb($dir);
+ $breadcrumb = \OCA\Files\Helper::makeBreadcrumb($dir);
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
@@ -34,7 +34,7 @@ if($doBreadcrumb) {
}
// make filelist
-$files = \OCA\files\lib\Helper::getFiles($dir);
+$files = \OCA\Files\Helper::getFiles($dir);
$list = new OCP\Template("files", "part.list", "");
$list->assign('files', $files, false);
diff --git a/apps/files/ajax/rawlist.php b/apps/files/ajax/rawlist.php
index 9ccd4cc299a..5ca0d5e8117 100644
--- a/apps/files/ajax/rawlist.php
+++ b/apps/files/ajax/rawlist.php
@@ -28,7 +28,7 @@ if($mimetypes && !in_array('httpd/unix-directory', $mimetypes)) {
$file['directory'] = $dir;
$file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']);
$file["date"] = OCP\Util::formatDate($file["mtime"]);
- $file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file);
+ $file['mimetype_icon'] = \OCA\Files\Helper::determineIcon($file);
$files[] = $file;
}
}
@@ -39,7 +39,7 @@ if (is_array($mimetypes) && count($mimetypes)) {
$file['directory'] = $dir;
$file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']);
$file["date"] = OCP\Util::formatDate($file["mtime"]);
- $file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file);
+ $file['mimetype_icon'] = \OCA\Files\Helper::determineIcon($file);
$files[] = $file;
}
}
@@ -48,7 +48,7 @@ if (is_array($mimetypes) && count($mimetypes)) {
$file['directory'] = $dir;
$file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']);
$file["date"] = OCP\Util::formatDate($file["mtime"]);
- $file['mimetype_icon'] = \OCA\files\lib\Helper::determineIcon($file);
+ $file['mimetype_icon'] = \OCA\Files\Helper::determineIcon($file);
$files[] = $file;
}
}
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 1d03cd89f83..0920bf62109 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -53,7 +53,7 @@ OCP\JSON::callCheck();
// get array with current storage stats (e.g. max file size)
-$storageStats = \OCA\files\lib\Helper::buildFileStorageStatistics($dir);
+$storageStats = \OCA\Files\Helper::buildFileStorageStatistics($dir);
if (!isset($_FILES['files'])) {
OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('No file was uploaded. Unknown error')), $storageStats)));
@@ -78,7 +78,7 @@ foreach ($_FILES['files']['error'] as $error) {
}
$files = $_FILES['files'];
-$error = '';
+$error = false;
$maxUploadFileSize = $storageStats['uploadMaxFilesize'];
$maxHumanFileSize = OCP\Util::humanFileSize($maxUploadFileSize);
@@ -98,33 +98,71 @@ $result = array();
if (strpos($dir, '..') === false) {
$fileCount = count($files['name']);
for ($i = 0; $i < $fileCount; $i++) {
- $target = OCP\Files::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
// $path needs to be normalized - this failed within drag'n'drop upload to a sub-folder
- $target = \OC\Files\Filesystem::normalizePath($target);
- if (is_uploaded_file($files['tmp_name'][$i]) and \OC\Files\Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) {
+ if (isset($_POST['resolution']) && $_POST['resolution']==='autorename') {
+ // append a number in brackets like 'filename (2).ext'
+ $target = OCP\Files::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
+ } else {
+ $target = \OC\Files\Filesystem::normalizePath(stripslashes($dir).'/'.$files['name'][$i]);
+ }
+
+ if ( ! \OC\Files\Filesystem::file_exists($target)
+ || (isset($_POST['resolution']) && $_POST['resolution']==='replace')
+ ) {
+ // upload and overwrite file
+ if (is_uploaded_file($files['tmp_name'][$i]) and \OC\Files\Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) {
+
+ // updated max file size after upload
+ $storageStats = \OCA\Files\Helper::buildFileStorageStatistics($dir);
+
+ $meta = \OC\Files\Filesystem::getFileInfo($target);
+ if ($meta === false) {
+ $error = $l->t('Upload failed. Could not get file info.');
+ } else {
+ $result[] = array('status' => 'success',
+ 'mime' => $meta['mimetype'],
+ 'mtime' => $meta['mtime'],
+ 'size' => $meta['size'],
+ 'id' => $meta['fileid'],
+ 'name' => basename($target),
+ 'originalname' => $files['tmp_name'][$i],
+ 'uploadMaxFilesize' => $maxUploadFileSize,
+ 'maxHumanFilesize' => $maxHumanFileSize,
+ 'permissions' => $meta['permissions'],
+ );
+ }
+
+ } else {
+ $error = $l->t('Upload failed. Could not find uploaded file');
+ }
+
+ } else {
+ // file already exists
$meta = \OC\Files\Filesystem::getFileInfo($target);
- // updated max file size after upload
- $storageStats = \OCA\files\lib\Helper::buildFileStorageStatistics($dir);
if ($meta === false) {
- OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Upload failed')), $storageStats)));
- exit();
+ $error = $l->t('Upload failed. Could not get file info.');
} else {
- $result[] = array('status' => 'success',
+ $result[] = array('status' => 'existserror',
'mime' => $meta['mimetype'],
+ 'mtime' => $meta['mtime'],
'size' => $meta['size'],
'id' => $meta['fileid'],
'name' => basename($target),
- 'originalname' => $files['name'][$i],
+ 'originalname' => $files['tmp_name'][$i],
'uploadMaxFilesize' => $maxUploadFileSize,
- 'maxHumanFilesize' => $maxHumanFileSize
+ 'maxHumanFilesize' => $maxHumanFileSize,
+ 'permissions' => $meta['permissions'],
);
}
}
}
- OCP\JSON::encodedPrint($result);
- exit();
} else {
$error = $l->t('Invalid directory.');
}
-OCP\JSON::error(array('data' => array_merge(array('message' => $error), $storageStats)));
+if ($error === false) {
+ OCP\JSON::encodedPrint($result);
+ exit();
+} else {
+ OCP\JSON::error(array('data' => array_merge(array('message' => $error), $storageStats)));
+}
diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php
index bd3245ded3f..909baca92ea 100644
--- a/apps/files/appinfo/app.php
+++ b/apps/files/appinfo/app.php
@@ -1,5 +1,4 @@
<?php
-OC::$CLASSPATH['OCA\Files\Capabilities'] = 'apps/files/lib/capabilities.php';
$l = OC_L10N::get('files');
diff --git a/apps/files/appinfo/register_command.php b/apps/files/appinfo/register_command.php
new file mode 100644
index 00000000000..435ce0ab23f
--- /dev/null
+++ b/apps/files/appinfo/register_command.php
@@ -0,0 +1,9 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+$application->add(new OCA\Files\Command\Scan(OC_User::getManager()));
diff --git a/apps/files/command/scan.php b/apps/files/command/scan.php
new file mode 100644
index 00000000000..25ab70af362
--- /dev/null
+++ b/apps/files/command/scan.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Copyright (c) 2013 Thomas Müller <thomas.mueller@tmit.eu>
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OCA\Files\Command;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class Scan extends Command {
+
+ /**
+ * @var \OC\User\Manager $userManager
+ */
+ private $userManager;
+
+ public function __construct(\OC\User\Manager $userManager) {
+ $this->userManager = $userManager;
+ parent::__construct();
+ }
+
+ protected function configure() {
+ $this
+ ->setName('files:scan')
+ ->setDescription('rescan filesystem')
+ ->addArgument(
+ 'user_id',
+ InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
+ 'will rescan all files of the given user(s)'
+ )
+ ->addOption(
+ 'all',
+ null,
+ InputOption::VALUE_NONE,
+ 'will rescan all files of all known users'
+ )
+ ;
+ }
+
+ protected function scanFiles($user, OutputInterface $output) {
+ $scanner = new \OC\Files\Utils\Scanner($user);
+ $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) use ($output) {
+ $output->writeln("Scanning <info>$path</info>");
+ });
+ $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) use ($output) {
+ $output->writeln("Scanning <info>$path</info>");
+ });
+ $scanner->scan('');
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output) {
+ if ($input->getOption('all')) {
+ $users = $this->userManager->search('');
+ } else {
+ $users = $input->getArgument('user_id');
+ }
+
+ foreach ($users as $user) {
+ if (is_object($user)) {
+ $user = $user->getUID();
+ }
+ $this->scanFiles($user, $output);
+ }
+ }
+}
diff --git a/apps/files/console/scan.php b/apps/files/console/scan.php
deleted file mode 100644
index 70183fc888a..00000000000
--- a/apps/files/console/scan.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-if (count($argv) !== 2) {
- echo "Usage:" . PHP_EOL;
- echo " files:scan <user_id>" . PHP_EOL;
- echo " will rescan all files of the given user" . PHP_EOL;
- echo " files:scan --all" . PHP_EOL;
- echo " will rescan all files of all known users" . PHP_EOL;
- return;
-}
-
-function scanFiles($user) {
- $scanner = new \OC\Files\Utils\Scanner($user);
- $scanner->listen('\OC\Files\Utils\Scanner', 'scanFile', function($path) {
- echo "Scanning $path" . PHP_EOL;
- });
- $scanner->listen('\OC\Files\Utils\Scanner', 'scanFolder', function($path) {
- echo "Scanning $path" . PHP_EOL;
- });
- $scanner->scan('');
-}
-
-if ($argv[1] === '--all') {
- $users = OC_User::getUsers();
-} else {
- $users = array($argv[1]);
-}
-
-foreach ($users as $user) {
- scanFiles($user);
-}
diff --git a/apps/files/css/files.css b/apps/files/css/files.css
index 41d9808c56b..b3ecd1dab93 100644
--- a/apps/files/css/files.css
+++ b/apps/files/css/files.css
@@ -76,6 +76,9 @@
#filestable tbody tr.selected {
background-color: rgb(230,230,230);
}
+#filestable tbody tr.searchresult {
+ background-color: rgb(240,240,240);
+}
tbody a { color:#000; }
span.extension, span.uploading, td.date { color:#999; }
span.extension { text-transform:lowercase; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; filter:alpha(opacity=70); opacity:.7; -webkit-transition:opacity 300ms; -moz-transition:opacity 300ms; -o-transition:opacity 300ms; transition:opacity 300ms; }
@@ -357,4 +360,3 @@ table.dragshadow td.size {
.mask.transparent{
opacity: 0;
}
-
diff --git a/apps/files/css/upload.css b/apps/files/css/upload.css
new file mode 100644
index 00000000000..2d11e41ba88
--- /dev/null
+++ b/apps/files/css/upload.css
@@ -0,0 +1,119 @@
+
+#upload {
+ height:27px; padding:0; margin-left:0.2em; overflow:hidden;
+ vertical-align: top;
+}
+#upload a {
+ position:relative; display:block; width:100%; height:27px;
+ cursor:pointer; z-index:10;
+ background-image:url('%webroot%/core/img/actions/upload.svg');
+ background-repeat:no-repeat;
+ background-position:7px 6px;
+ opacity:0.65;
+}
+.file_upload_target { display:none; }
+.file_upload_form { display:inline; float:left; margin:0; padding:0; cursor:pointer; overflow:visible; }
+#file_upload_start {
+ float: left;
+ left:0; top:0; width:28px; height:27px; padding:0;
+ font-size:1em;
+ -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0;
+ z-index:20; position:relative; cursor:pointer; overflow:hidden;
+}
+
+#uploadprogresswrapper {
+ display: inline-block;
+ vertical-align: top;
+ margin:0.3em;
+ height: 29px;
+}
+#uploadprogressbar {
+ position:relative;
+ float: left;
+ margin-left: 12px;
+ width: 130px;
+ height: 26px;
+ display:inline-block;
+}
+#uploadprogressbar + stop {
+ font-size: 13px;
+}
+
+.oc-dialog .fileexists table {
+ width: 100%;
+}
+.oc-dialog .fileexists th {
+ padding-left: 0;
+ padding-right: 0;
+}
+.oc-dialog .fileexists th input[type='checkbox'] {
+ margin-right: 3px;
+}
+.oc-dialog .fileexists th:first-child {
+ width: 230px;
+}
+.oc-dialog .fileexists th label {
+ font-weight: normal;
+ color:black;
+}
+.oc-dialog .fileexists th .count {
+ margin-left: 3px;
+}
+.oc-dialog .fileexists .conflicts .template {
+ display: none;
+}
+.oc-dialog .fileexists .conflict {
+ width: 100%;
+ height: 85px;
+}
+.oc-dialog .fileexists .conflict .filename {
+ color:#777;
+ word-break: break-all;
+ clear: left;
+}
+.oc-dialog .fileexists .icon {
+ width: 64px;
+ height: 64px;
+ margin: 0px 5px 5px 5px;
+ background-repeat: no-repeat;
+ background-size: 64px 64px;
+ float: left;
+}
+.oc-dialog .fileexists .replacement {
+ float: left;
+ width: 230px;
+}
+.oc-dialog .fileexists .original {
+ float: left;
+ width: 230px;
+}
+.oc-dialog .fileexists .conflicts {
+ overflow-y:scroll;
+ max-height: 225px;
+}
+.oc-dialog .fileexists .conflict input[type='checkbox'] {
+ float: left;
+}
+.oc-dialog .fileexists .toggle {
+ background-image: url('%webroot%/core/img/actions/triangle-e.png');
+ width: 16px;
+ height: 16px;
+}
+.oc-dialog .fileexists #allfileslabel {
+ float:right;
+}
+.oc-dialog .fileexists #allfiles {
+ vertical-align: bottom;
+ position: relative;
+ top: -3px;
+}
+.oc-dialog .fileexists #allfiles + span{
+ vertical-align: bottom;
+}
+.oc-dialog .oc-dialog-buttonrow {
+ width:100%;
+ text-align:right;
+}
+.oc-dialog .oc-dialog-buttonrow .cancel {
+ float:left;
+}
diff --git a/apps/files/index.php b/apps/files/index.php
index 5ef69a5d35e..ecd539dbed4 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -26,6 +26,7 @@ OCP\User::checkLoggedIn();
// Load the files we need
OCP\Util::addStyle('files', 'files');
+OCP\Util::addStyle('files', 'upload');
OCP\Util::addscript('files', 'file-upload');
OCP\Util::addscript('files', 'jquery.iframe-transport');
OCP\Util::addscript('files', 'jquery.fileupload');
@@ -73,14 +74,14 @@ if (\OC\Files\Cache\Upgrade::needUpgrade($user)) { //dont load anything if we ne
$ajaxLoad = true;
}
else{
- $files = \OCA\files\lib\Helper::getFiles($dir);
+ $files = \OCA\Files\Helper::getFiles($dir);
}
$freeSpace = \OC\Files\Filesystem::free_space($dir);
$needUpgrade = false;
}
// Make breadcrumb
-$breadcrumb = \OCA\files\lib\Helper::makeBreadcrumb($dir);
+$breadcrumb = \OCA\Files\Helper::makeBreadcrumb($dir);
// make breadcrumb und filelist markup
$list = new OCP\Template('files', 'part.list', '');
@@ -92,7 +93,7 @@ $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
$breadcrumbNav->assign('breadcrumb', $breadcrumb);
$breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir=');
-$permissions = \OCA\files\lib\Helper::getDirPermissions($dir);
+$permissions = \OCA\Files\Helper::getDirPermissions($dir);
if ($needUpgrade) {
OCP\Util::addscript('files', 'upgrade');
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index aeb2da90d5f..b52221ac1fc 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -1,157 +1,436 @@
-$(document).ready(function() {
-
- var file_upload_param = {
- dropZone: $('#content'), // restrict dropZone to content div
- //singleFileUploads is on by default, so the data.files array will always have length 1
- add: function(e, data) {
-
- if(data.files[0].type === '' && data.files[0].size == 4096)
- {
- data.textStatus = 'dirorzero';
- data.errorThrown = t('files','Unable to upload your file as it is a directory or has 0 bytes');
- var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
- fu._trigger('fail', e, data);
- return true; //don't upload this file but go on with next in queue
- }
+/**
+ * The file upload code uses several hooks to interact with blueimps jQuery file upload library:
+ * 1. the core upload handling hooks are added when initializing the plugin,
+ * 2. if the browser supports progress events they are added in a separate set after the initialization
+ * 3. every app can add it's own triggers for fileupload
+ * - files adds d'n'd handlers and also reacts to done events to add new rows to the filelist
+ * - TODO pictures upload button
+ * - TODO music upload button
+ */
- var totalSize=0;
- $.each(data.originalFiles, function(i,file){
- totalSize+=file.size;
- });
+/**
+ * Function that will allow us to know if Ajax uploads are supported
+ * @link https://github.com/New-Bamboo/example-ajax-upload/blob/master/public/index.html
+ * also see article @link http://blog.new-bamboo.co.uk/2012/01/10/ridiculously-simple-ajax-uploads-with-formdata
+ */
+function supportAjaxUploadWithProgress() {
+ return supportFileAPI() && supportAjaxUploadProgressEvents() && supportFormData();
- if(totalSize>$('#max_upload').val()){
- data.textStatus = 'notenoughspace';
- data.errorThrown = t('files','Not enough space available');
- var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
- fu._trigger('fail', e, data);
- return false; //don't upload anything
- }
+ // Is the File API supported?
+ function supportFileAPI() {
+ var fi = document.createElement('INPUT');
+ fi.type = 'file';
+ return 'files' in fi;
+ };
- // start the actual file upload
- var jqXHR = data.submit();
+ // Are progress events supported?
+ function supportAjaxUploadProgressEvents() {
+ var xhr = new XMLHttpRequest();
+ return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));
+ };
- // remember jqXHR to show warning to user when he navigates away but an upload is still in progress
- if (typeof data.context !== 'undefined' && data.context.data('type') === 'dir') {
- var dirName = data.context.data('file');
- if(typeof uploadingFiles[dirName] === 'undefined') {
- uploadingFiles[dirName] = {};
- }
- uploadingFiles[dirName][data.files[0].name] = jqXHR;
- } else {
- uploadingFiles[data.files[0].name] = jqXHR;
- }
+ // Is FormData supported?
+ function supportFormData() {
+ return !! window.FormData;
+ }
+}
- //show cancel button
- if($('html.lte9').length === 0 && data.dataType !== 'iframe') {
- $('#uploadprogresswrapper input.stop').show();
- }
- },
- submit: function(e, data) {
- if ( ! data.formData ) {
- // noone set update parameters, we set the minimum
- data.formData = {
- requesttoken: oc_requesttoken,
- dir: $('#dir').val()
- };
- }
- },
- /**
- * called after the first add, does NOT have the data param
- * @param e
- */
- start: function(e) {
- //IE < 10 does not fire the necessary events for the progress bar.
- if($('html.lte9').length > 0) {
- return;
+/**
+ * keeps track of uploads in progress and implements callbacks for the conflicts dialog
+ * @type {OC.Upload}
+ */
+OC.Upload = {
+ _uploads: [],
+ /**
+ * cancels a single upload,
+ * @deprecated because it was only used when a file currently beeing uploaded was deleted. Now they are added after
+ * they have been uploaded.
+ * @param {string} dir
+ * @param {string} filename
+ * @returns {unresolved}
+ */
+ cancelUpload:function(dir, filename) {
+ var self = this;
+ var deleted = false;
+ //FIXME _selections
+ jQuery.each(this._uploads, function(i, jqXHR) {
+ if (selection.dir === dir && selection.uploads[filename]) {
+ deleted = self.deleteSelectionUpload(selection, filename);
+ return false; // end searching through selections
}
- $('#uploadprogressbar').progressbar({value:0});
- $('#uploadprogressbar').fadeIn();
- },
- fail: function(e, data) {
- if (typeof data.textStatus !== 'undefined' && data.textStatus !== 'success' ) {
- if (data.textStatus === 'abort') {
- $('#notification').text(t('files', 'Upload cancelled.'));
- } else {
- // HTTP connection problem
- $('#notification').text(data.errorThrown);
- }
- $('#notification').fadeIn();
- //hide notification after 5 sec
- setTimeout(function() {
- $('#notification').fadeOut();
- }, 5000);
- }
- delete uploadingFiles[data.files[0].name];
- },
- progress: function(e, data) {
- // TODO: show nice progress bar in file row
- },
- progressall: function(e, data) {
- //IE < 10 does not fire the necessary events for the progress bar.
- if($('html.lte9').length > 0) {
- return;
+ });
+ return deleted;
+ },
+ /**
+ * deletes the jqHXR object from a data selection
+ * @param {object} data
+ */
+ deleteUpload:function(data) {
+ delete data.jqXHR;
+ },
+ /**
+ * cancels all uploads
+ */
+ cancelUploads:function() {
+ this.log('canceling uploads');
+ jQuery.each(this._uploads,function(i, jqXHR){
+ jqXHR.abort();
+ });
+ this._uploads = [];
+ },
+ rememberUpload:function(jqXHR){
+ if (jqXHR) {
+ this._uploads.push(jqXHR);
+ }
+ },
+ /**
+ * Checks the currently known uploads.
+ * returns true if any hxr has the state 'pending'
+ * @returns {boolean}
+ */
+ isProcessing:function(){
+ var count = 0;
+
+ jQuery.each(this._uploads,function(i, data){
+ if (data.state() === 'pending') {
+ count++;
}
- var progress = (data.loaded/data.total)*100;
- $('#uploadprogressbar').progressbar('value',progress);
- },
- /**
- * called for every successful upload
- * @param e
- * @param data
- */
- done:function(e, data) {
- // handle different responses (json or body from iframe for ie)
- var response;
- if (typeof data.result === 'string') {
- response = data.result;
+ });
+ return count > 0;
+ },
+ /**
+ * callback for the conflicts dialog
+ * @param {object} data
+ */
+ onCancel:function(data) {
+ this.cancelUploads();
+ },
+ /**
+ * callback for the conflicts dialog
+ * calls onSkip, onReplace or onAutorename for each conflict
+ * @param {object} conflicts - list of conflict elements
+ */
+ onContinue:function(conflicts) {
+ var self = this;
+ //iterate over all conflicts
+ jQuery.each(conflicts, function (i, conflict) {
+ conflict = $(conflict);
+ var keepOriginal = conflict.find('.original input[type="checkbox"]:checked').length === 1;
+ var keepReplacement = conflict.find('.replacement input[type="checkbox"]:checked').length === 1;
+ if (keepOriginal && keepReplacement) {
+ // when both selected -> autorename
+ self.onAutorename(conflict.data('data'));
+ } else if (keepReplacement) {
+ // when only replacement selected -> overwrite
+ self.onReplace(conflict.data('data'));
} else {
- //fetch response from iframe
- response = data.result[0].body.innerText;
+ // when only original seleted -> skip
+ // when none selected -> skip
+ self.onSkip(conflict.data('data'));
}
- var result=$.parseJSON(response);
+ });
+ },
+ /**
+ * handle skipping an upload
+ * @param {object} data
+ */
+ onSkip:function(data){
+ this.log('skip', null, data);
+ this.deleteUpload(data);
+ },
+ /**
+ * handle replacing a file on the server with an uploaded file
+ * @param {object} data
+ */
+ onReplace:function(data){
+ this.log('replace', null, data);
+ data.data.append('resolution', 'replace');
+ data.submit();
+ },
+ /**
+ * handle uploading a file and letting the server decide a new name
+ * @param {object} data
+ */
+ onAutorename:function(data){
+ this.log('autorename', null, data);
+ if (data.data) {
+ data.data.append('resolution', 'autorename');
+ } else {
+ data.formData.push({name:'resolution',value:'autorename'}); //hack for ie8
+ }
+ data.submit();
+ },
+ _trace:false, //TODO implement log handler for JS per class?
+ log:function(caption, e, data) {
+ if (this._trace) {
+ console.log(caption);
+ console.log(data);
+ }
+ },
+ /**
+ * TODO checks the list of existing files prior to uploading and shows a simple dialog to choose
+ * skip all, replace all or choose which files to keep
+ * @param {array} selection of files to upload
+ * @param {object} callbacks - object with several callback methods
+ * @param {function} callbacks.onNoConflicts
+ * @param {function} callbacks.onSkipConflicts
+ * @param {function} callbacks.onReplaceConflicts
+ * @param {function} callbacks.onChooseConflicts
+ * @param {function} callbacks.onCancel
+ */
+ checkExistingFiles: function (selection, callbacks){
+ // TODO check filelist before uploading and show dialog on conflicts, use callbacks
+ callbacks.onNoConflicts(selection);
+ }
+};
+
+$(document).ready(function() {
+
+ if ( $('#file_upload_start').exists() ) {
+
+ var file_upload_param = {
+ dropZone: $('#content'), // restrict dropZone to content div
+ autoUpload: false,
+ sequentialUploads: true,
+ //singleFileUploads is on by default, so the data.files array will always have length 1
+ /**
+ * on first add of every selection
+ * - check all files of originalFiles array with files in dir
+ * - on conflict show dialog
+ * - skip all -> remember as single skip action for all conflicting files
+ * - replace all -> remember as single replace action for all conflicting files
+ * - choose -> show choose dialog
+ * - mark files to keep
+ * - when only existing -> remember as single skip action
+ * - when only new -> remember as single replace action
+ * - when both -> remember as single autorename action
+ * - start uploading selection
+ * @param {object} e
+ * @param {object} data
+ * @returns {boolean}
+ */
+ add: function(e, data) {
+ OC.Upload.log('add', e, data);
+ var that = $(this);
+
+ // we need to collect all data upload objects before starting the upload so we can check their existence
+ // and set individual conflict actions. unfortunately there is only one variable that we can use to identify
+ // the selection a data upload is part of, so we have to collect them in data.originalFiles
+ // turning singleFileUploads off is not an option because we want to gracefully handle server errors like
+ // already exists
+
+ // create a container where we can store the data objects
+ if ( ! data.originalFiles.selection ) {
+ // initialize selection and remember number of files to upload
+ data.originalFiles.selection = {
+ uploads: [],
+ filesToUpload: data.originalFiles.length,
+ totalBytes: 0
+ };
+ }
+ var selection = data.originalFiles.selection;
+
+ // add uploads
+ if ( selection.uploads.length < selection.filesToUpload ){
+ // remember upload
+ selection.uploads.push(data);
+ }
+
+ //examine file
+ var file = data.files[0];
+
+ if (file.type === '' && file.size === 4096) {
+ data.textStatus = 'dirorzero';
+ data.errorThrown = t('files', 'Unable to upload {filename} as it is a directory or has 0 bytes',
+ {filename: file.name}
+ );
+ }
+
+ // add size
+ selection.totalBytes += file.size;
+
+ //check max upload size
+ if (selection.totalBytes > $('#max_upload').val()) {
+ data.textStatus = 'notenoughspace';
+ data.errorThrown = t('files', 'Not enough space available');
+ }
+
+ // end upload for whole selection on error
+ if (data.errorThrown) {
+ // trigger fileupload fail
+ var fu = that.data('blueimp-fileupload') || that.data('fileupload');
+ fu._trigger('fail', e, data);
+ return false; //don't upload anything
+ }
- if(typeof result[0] !== 'undefined' && result[0].status === 'success') {
- var filename = result[0].originalname;
+ // check existing files when all is collected
+ if ( selection.uploads.length >= selection.filesToUpload ) {
+
+ //remove our selection hack:
+ delete data.originalFiles.selection;
+
+ var callbacks = {
+
+ onNoConflicts: function (selection) {
+ $.each(selection.uploads, function(i, upload) {
+ upload.submit();
+ });
+ },
+ onSkipConflicts: function (selection) {
+ //TODO mark conflicting files as toskip
+ },
+ onReplaceConflicts: function (selection) {
+ //TODO mark conflicting files as toreplace
+ },
+ onChooseConflicts: function (selection) {
+ //TODO mark conflicting files as chosen
+ },
+ onCancel: function (selection) {
+ $.each(selection.uploads, function(i, upload) {
+ upload.abort();
+ });
+ }
+ };
- // delete jqXHR reference
- if (typeof data.context !== 'undefined' && data.context.data('type') === 'dir') {
- var dirName = data.context.data('file');
- delete uploadingFiles[dirName][filename];
- if ($.assocArraySize(uploadingFiles[dirName]) == 0) {
- delete uploadingFiles[dirName];
+ OC.Upload.checkExistingFiles(selection, callbacks);
+
+ }
+
+ return true; // continue adding files
+ },
+ /**
+ * called after the first add, does NOT have the data param
+ * @param {object} e
+ */
+ start: function(e) {
+ OC.Upload.log('start', e, null);
+ },
+ submit: function(e, data) {
+ OC.Upload.rememberUpload(data);
+ if ( ! data.formData ) {
+ // noone set update parameters, we set the minimum
+ data.formData = {
+ requesttoken: oc_requesttoken,
+ dir: $('#dir').val()
+ };
+ }
+ },
+ fail: function(e, data) {
+ OC.Upload.log('fail', e, data);
+ if (typeof data.textStatus !== 'undefined' && data.textStatus !== 'success' ) {
+ if (data.textStatus === 'abort') {
+ $('#notification').text(t('files', 'Upload cancelled.'));
+ } else {
+ // HTTP connection problem
+ $('#notification').text(data.errorThrown);
}
+ $('#notification').fadeIn();
+ //hide notification after 5 sec
+ setTimeout(function() {
+ $('#notification').fadeOut();
+ }, 5000);
+ }
+ OC.Upload.deleteUpload(data);
+ },
+ /**
+ * called for every successful upload
+ * @param {object} e
+ * @param {object} data
+ */
+ done:function(e, data) {
+ OC.Upload.log('done', e, data);
+ // handle different responses (json or body from iframe for ie)
+ var response;
+ if (typeof data.result === 'string') {
+ response = data.result;
} else {
- delete uploadingFiles[filename];
+ //fetch response from iframe
+ response = data.result[0].body.innerText;
}
- var file = result[0];
- } else {
- data.textStatus = 'servererror';
- data.errorThrown = t('files', result.data.message);
- var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
- fu._trigger('fail', e, data);
- }
- },
- /**
- * called after last upload
- * @param e
- * @param data
- */
- stop: function(e, data) {
- if(data.dataType !== 'iframe') {
- $('#uploadprogresswrapper input.stop').hide();
- }
+ var result=$.parseJSON(response);
- //IE < 10 does not fire the necessary events for the progress bar.
- if($('html.lte9').length > 0) {
- return;
+ delete data.jqXHR;
+
+ if(typeof result[0] === 'undefined') {
+ data.textStatus = 'servererror';
+ data.errorThrown = t('files', 'Could not get result from server.');
+ var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
+ fu._trigger('fail', e, data);
+ } else if (result[0].status === 'existserror') {
+ //show "file already exists" dialog
+ var original = result[0];
+ var replacement = data.files[0];
+ var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
+ OC.dialogs.fileexists(data, original, replacement, OC.Upload, fu);
+ } else if (result[0].status !== 'success') {
+ //delete data.jqXHR;
+ data.textStatus = 'servererror';
+ data.errorThrown = result.data.message; // error message has been translated on server
+ var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
+ fu._trigger('fail', e, data);
+ }
+ },
+ /**
+ * called after last upload
+ * @param {object} e
+ * @param {object} data
+ */
+ stop: function(e, data) {
+ OC.Upload.log('stop', e, data);
}
+ };
+
+ // initialize jquery fileupload (blueimp)
+ var fileupload = $('#file_upload_start').fileupload(file_upload_param);
+ window.file_upload_param = fileupload;
- $('#uploadprogressbar').progressbar('value',100);
- $('#uploadprogressbar').fadeOut();
+ if(supportAjaxUploadWithProgress()) {
+
+ // add progress handlers
+ fileupload.on('fileuploadadd', function(e, data) {
+ OC.Upload.log('progress handle fileuploadadd', e, data);
+ //show cancel button
+ //if(data.dataType !== 'iframe') { //FIXME when is iframe used? only for ie?
+ // $('#uploadprogresswrapper input.stop').show();
+ //}
+ });
+ // add progress handlers
+ fileupload.on('fileuploadstart', function(e, data) {
+ OC.Upload.log('progress handle fileuploadstart', e, data);
+ $('#uploadprogresswrapper input.stop').show();
+ $('#uploadprogressbar').progressbar({value:0});
+ $('#uploadprogressbar').fadeIn();
+ });
+ fileupload.on('fileuploadprogress', function(e, data) {
+ OC.Upload.log('progress handle fileuploadprogress', e, data);
+ //TODO progressbar in row
+ });
+ fileupload.on('fileuploadprogressall', function(e, data) {
+ OC.Upload.log('progress handle fileuploadprogressall', e, data);
+ var progress = (data.loaded / data.total) * 100;
+ $('#uploadprogressbar').progressbar('value', progress);
+ });
+ fileupload.on('fileuploadstop', function(e, data) {
+ OC.Upload.log('progress handle fileuploadstop', e, data);
+
+ $('#uploadprogresswrapper input.stop').fadeOut();
+ $('#uploadprogressbar').fadeOut();
+
+ });
+ fileupload.on('fileuploadfail', function(e, data) {
+ OC.Upload.log('progress handle fileuploadfail', e, data);
+ //if user pressed cancel hide upload progress bar and cancel button
+ if (data.errorThrown === 'abort') {
+ $('#uploadprogresswrapper input.stop').fadeOut();
+ $('#uploadprogressbar').fadeOut();
+ }
+ });
+
+ } else {
+ console.log('skipping file progress because your browser is broken');
}
- };
- $('#file_upload_start').fileupload(file_upload_param);
-
+ }
+
$.assocArraySize = function(obj) {
// http://stackoverflow.com/a/6700/11236
var size = 0, key;
@@ -162,9 +441,9 @@ $(document).ready(function() {
};
// warn user not to leave the page while upload is in progress
- $(window).bind('beforeunload', function(e) {
- if ($.assocArraySize(uploadingFiles) > 0) {
- return t('files','File upload is in progress. Leaving the page now will cancel the upload.');
+ $(window).on('beforeunload', function(e) {
+ if (OC.Upload.isProcessing()) {
+ return t('files', 'File upload is in progress. Leaving the page now will cancel the upload.');
}
});
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 330fe86f6b3..67d3d5ead8d 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -68,6 +68,9 @@ var FileActions = {
if ($('tr[data-file="'+file+'"]').data('renaming')) {
return;
}
+
+ // recreate fileactions
+ parent.children('a.name').find('.fileactions').remove();
parent.children('a.name').append('<span class="fileactions" />');
var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
@@ -117,6 +120,8 @@ var FileActions = {
addAction('Share', actions.Share);
}
+ // remove the existing delete action
+ parent.parent().children().last().find('.action.delete').remove();
if (actions['Delete']) {
var img = FileActions.icons['Delete'];
if (img.call) {
@@ -172,7 +177,7 @@ $(document).ready(function () {
FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () {
return OC.imagePath('core', 'actions/delete');
}, function (filename) {
- if (Files.cancelUpload(filename)) {
+ if (OC.Upload.cancelUpload($('#dir').val(), filename)) {
if (filename.substr) {
filename = [filename];
}
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index b50d46c98d3..4fc1b95a0ab 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -130,7 +130,6 @@ var FileList={
if (hidden) {
tr.hide();
}
- FileActions.display(tr.find('td.filename'));
return tr;
},
addDir:function(name,size,lastModified,hidden){
@@ -643,6 +642,37 @@ var FileList={
if (FileList._maskTimeout){
window.clearTimeout(FileList._maskTimeout);
}
+ },
+ scrollTo:function(file) {
+ //scroll to and highlight preselected file
+ var scrolltorow = $('tr[data-file="'+file+'"]');
+ if (scrolltorow.length > 0) {
+ scrolltorow.addClass('searchresult');
+ $(window).scrollTop(scrolltorow.position().top);
+ //remove highlight when hovered over
+ scrolltorow.one('hover', function(){
+ scrolltorow.removeClass('searchresult');
+ });
+ }
+ },
+ filter:function(query){
+ $('#fileList tr:not(.summary)').each(function(i,e){
+ if ($(e).data('file').toLowerCase().indexOf(query.toLowerCase()) !== -1) {
+ $(e).addClass("searchresult");
+ } else {
+ $(e).removeClass("searchresult");
+ }
+ });
+ //do not use scrollto to prevent removing searchresult css class
+ var first = $('#fileList tr.searchresult').first();
+ if (first.length !== 0) {
+ $(window).scrollTop(first.position().top);
+ }
+ },
+ unfilter:function(){
+ $('#fileList tr.searchresult').each(function(i,e){
+ $(e).removeClass("searchresult");
+ });
}
};
@@ -650,147 +680,167 @@ $(document).ready(function(){
// handle upload events
var file_upload_start = $('#file_upload_start');
+
file_upload_start.on('fileuploaddrop', function(e, data) {
- // only handle drop to dir if fileList exists
- if ($('#fileList').length > 0) {
- var dropTarget = $(e.originalEvent.target).closest('tr');
- if(dropTarget && dropTarget.data('type') === 'dir') { // drag&drop upload to folder
- var dirName = dropTarget.data('file');
- // update folder in form
- data.formData = function(form) {
- var formArray = form.serializeArray();
- // array index 0 contains the max files size
- // array index 1 contains the request token
- // array index 2 contains the directory
- var parentDir = formArray[2]['value'];
- if (parentDir === '/') {
- formArray[2]['value'] += dirName;
- } else {
- formArray[2]['value'] += '/'+dirName;
- }
- return formArray;
+ OC.Upload.log('filelist handle fileuploaddrop', e, data);
+
+ var dropTarget = $(e.originalEvent.target).closest('tr');
+ if(dropTarget && dropTarget.data('type') === 'dir') { // drag&drop upload to folder
+
+ // remember as context
+ data.context = dropTarget;
+
+ var dir = dropTarget.data('file');
+
+ // update folder in form
+ data.formData = function(form) {
+ var formArray = form.serializeArray();
+ // array index 0 contains the max files size
+ // array index 1 contains the request token
+ // array index 2 contains the directory
+ var parentDir = formArray[2]['value'];
+ if (parentDir === '/') {
+ formArray[2]['value'] += dir;
+ } else {
+ formArray[2]['value'] += '/' + dir;
}
- }
- }
+
+ return formArray;
+ };
+ }
+
});
file_upload_start.on('fileuploadadd', function(e, data) {
- // only add to fileList if it exists
- if ($('#fileList').length > 0) {
+ OC.Upload.log('filelist handle fileuploadadd', e, data);
- if(FileList.deleteFiles && FileList.deleteFiles.indexOf(data.files[0].name)!=-1){//finish delete if we are uploading a deleted file
- FileList.finishDelete(null, true); //delete file before continuing
+ //finish delete if we are uploading a deleted file
+ if(FileList.deleteFiles && FileList.deleteFiles.indexOf(data.files[0].name)!==-1){
+ FileList.finishDelete(null, true); //delete file before continuing
+ }
+
+ // add ui visualization to existing folder
+ if(data.context && data.context.data('type') === 'dir') {
+ // add to existing folder
+
+ // update upload counter ui
+ var uploadtext = data.context.find('.uploadtext');
+ var currentUploads = parseInt(uploadtext.attr('currentUploads'));
+ currentUploads += 1;
+ uploadtext.attr('currentUploads', currentUploads);
+
+ var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads);
+ if(currentUploads === 1) {
+ var img = OC.imagePath('core', 'loading.gif');
+ data.context.find('td.filename').attr('style','background-image:url('+img+')');
+ uploadtext.text(translatedText);
+ uploadtext.show();
+ } else {
+ uploadtext.text(translatedText);
}
+ }
+
+ });
+ /*
+ * when file upload done successfully add row to filelist
+ * update counter when uploading to sub folder
+ */
+ file_upload_start.on('fileuploaddone', function(e, data) {
+ OC.Upload.log('filelist handle fileuploaddone', e, data);
+
+ var response;
+ if (typeof data.result === 'string') {
+ response = data.result;
+ } else {
+ // fetch response from iframe
+ response = data.result[0].body.innerText;
+ }
+ var result=$.parseJSON(response);
- // add ui visualization to existing folder or as new stand-alone file?
- var dropTarget = $(e.originalEvent.target).closest('tr');
- if(dropTarget && dropTarget.data('type') === 'dir') {
- // add to existing folder
- var dirName = dropTarget.data('file');
+ if(typeof result[0] !== 'undefined' && result[0].status === 'success') {
+ var file = result[0];
- // set dir context
- data.context = $('tr').filterAttr('data-type', 'dir').filterAttr('data-file', dirName);
+ if (data.context && data.context.data('type') === 'dir') {
// update upload counter ui
var uploadtext = data.context.find('.uploadtext');
var currentUploads = parseInt(uploadtext.attr('currentUploads'));
- currentUploads += 1;
+ currentUploads -= 1;
uploadtext.attr('currentUploads', currentUploads);
var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads);
- if(currentUploads === 1) {
- var img = OC.imagePath('core', 'loading.gif');
+ if(currentUploads === 0) {
+ var img = OC.imagePath('core', 'filetypes/folder.png');
data.context.find('td.filename').attr('style','background-image:url('+img+')');
uploadtext.text(translatedText);
- uploadtext.show();
+ uploadtext.hide();
} else {
uploadtext.text(translatedText);
}
+
+ // update folder size
+ var size = parseInt(data.context.data('size'));
+ size += parseInt(file.size);
+ data.context.attr('data-size', size);
+ data.context.find('td.filesize').text(humanFileSize(size));
+
} else {
+
// add as stand-alone row to filelist
- var uniqueName = getUniqueName(data.files[0].name);
- var size=t('files','Pending');
- if(data.files[0].size>=0){
+ var size=t('files', 'Pending');
+ if (data.files[0].size>=0){
size=data.files[0].size;
}
var date=new Date();
var param = {};
if ($('#publicUploadRequestToken').length) {
- param.download_url = document.location.href + '&download&path=/' + $('#dir').val() + '/' + uniqueName;
+ param.download_url = document.location.href + '&download&path=/' + $('#dir').val() + '/' + file.name;
}
+ //should the file exist in the list remove it
+ FileList.remove(file.name);
+
// create new file context
- data.context = FileList.addFile(uniqueName,size,date,true,false,param);
+ data.context = FileList.addFile(file.name, file.size, date, false, false, param);
+
+ // update file data
+ data.context.attr('data-mime',file.mime).attr('data-id',file.id);
+
+ var permissions = data.context.data('permissions');
+ if(permissions != file.permissions) {
+ data.context.attr('data-permissions', file.permissions);
+ data.context.data('permissions', file.permissions);
+ }
+ FileActions.display(data.context.find('td.filename'));
+ var path = getPathForPreview(file.name);
+ lazyLoadPreview(path, file.mime, function(previewpath){
+ data.context.find('td.filename').attr('style','background-image:url('+previewpath+')');
+ });
}
}
});
- file_upload_start.on('fileuploaddone', function(e, data) {
- // only update the fileList if it exists
- if ($('#fileList').length > 0) {
- var response;
- if (typeof data.result === 'string') {
- response = data.result;
- } else {
- // fetch response from iframe
- response = data.result[0].body.innerText;
- }
- var result=$.parseJSON(response);
-
- if(typeof result[0] !== 'undefined' && result[0].status === 'success') {
- var file = result[0];
-
- if (data.context.data('type') === 'file') {
- // update file data
- data.context.attr('data-mime',file.mime).attr('data-id',file.id);
- var size = data.context.data('size');
- if(size!=file.size){
- data.context.attr('data-size', file.size);
- data.context.find('td.filesize').text(humanFileSize(file.size));
- }
- if (FileList.loadingDone) {
- FileList.loadingDone(file.name, file.id);
- }
- } else {
- // update upload counter ui
- var uploadtext = data.context.find('.uploadtext');
- var currentUploads = parseInt(uploadtext.attr('currentUploads'));
- currentUploads -= 1;
- uploadtext.attr('currentUploads', currentUploads);
- if(currentUploads === 0) {
- var img = OC.imagePath('core', 'filetypes/folder.png');
- data.context.find('td.filename').attr('style','background-image:url('+img+')');
- uploadtext.text('');
- uploadtext.hide();
- } else {
- uploadtext.text(currentUploads + ' ' + t('files', 'files uploading'));
- }
+ file_upload_start.on('fileuploadstop', function(e, data) {
+ OC.Upload.log('filelist handle fileuploadstop', e, data);
- // update folder size
- var size = parseInt(data.context.data('size'));
- size += parseInt(file.size);
- data.context.attr('data-size', size);
- data.context.find('td.filesize').text(humanFileSize(size));
-
- }
- }
+ //if user pressed cancel hide upload chrome
+ if (data.errorThrown === 'abort') {
+ //cleanup uploading to a dir
+ var uploadtext = $('tr .uploadtext');
+ var img = OC.imagePath('core', 'filetypes/folder.png');
+ uploadtext.parents('td.filename').attr('style','background-image:url('+img+')');
+ uploadtext.fadeOut();
+ uploadtext.attr('currentUploads', 0);
}
});
file_upload_start.on('fileuploadfail', function(e, data) {
- // only update the fileList if it exists
- // cleanup files, error notification has been shown by fileupload code
- var tr = data.context;
- if (typeof tr === 'undefined') {
- tr = $('tr').filterAttr('data-file', data.files[0].name);
- }
- if (tr.attr('data-type') === 'dir') {
+ OC.Upload.log('filelist handle fileuploadfail', e, data);
+
+ //if user pressed cancel hide upload chrome
+ if (data.errorThrown === 'abort') {
//cleanup uploading to a dir
- var uploadtext = tr.find('.uploadtext');
+ var uploadtext = $('tr .uploadtext');
var img = OC.imagePath('core', 'filetypes/folder.png');
- tr.find('td.filename').attr('style','background-image:url('+img+')');
- uploadtext.text('');
- uploadtext.hide(); //TODO really hide already
- } else {
- //remove file
- tr.fadeOut();
- tr.remove();
+ uploadtext.parents('td.filename').attr('style','background-image:url('+img+')');
+ uploadtext.fadeOut();
+ uploadtext.attr('currentUploads', 0);
}
});
@@ -818,16 +868,16 @@ $(document).ready(function(){
FileList.replaceIsNewFile = null;
}
FileList.lastAction = null;
- OC.Notification.hide();
+ OC.Notification.hide();
});
$('#notification:first-child').on('click', '.replace', function() {
- OC.Notification.hide(function() {
- FileList.replace($('#notification > span').attr('data-oldName'), $('#notification > span').attr('data-newName'), $('#notification > span').attr('data-isNewFile'));
- });
+ OC.Notification.hide(function() {
+ FileList.replace($('#notification > span').attr('data-oldName'), $('#notification > span').attr('data-newName'), $('#notification > span').attr('data-isNewFile'));
+ });
});
$('#notification:first-child').on('click', '.suggest', function() {
$('tr').filterAttr('data-file', $('#notification > span').attr('data-oldName')).show();
- OC.Notification.hide();
+ OC.Notification.hide();
});
$('#notification:first-child').on('click', '.cancel', function() {
if ($('#notification > span').attr('data-isNewFile')) {
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 01a82308a8b..5edab491538 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -1,31 +1,4 @@
-var uploadingFiles = {};
Files={
- cancelUpload:function(filename) {
- if(uploadingFiles[filename]) {
- uploadingFiles[filename].abort();
- delete uploadingFiles[filename];
- return true;
- }
- return false;
- },
- cancelUploads:function() {
- $.each(uploadingFiles,function(index,file) {
- if(typeof file['abort'] === 'function') {
- file.abort();
- var filename = $('tr').filterAttr('data-file',index);
- filename.hide();
- filename.find('input[type="checkbox"]').removeAttr('checked');
- filename.removeClass('selected');
- } else {
- $.each(file,function(i,f) {
- f.abort();
- delete file[i];
- });
- }
- delete uploadingFiles[index];
- });
- procesSelection();
- },
updateMaxUploadFilesize:function(response) {
if(response == undefined) {
return;
@@ -217,7 +190,8 @@ $(document).ready(function() {
// Trigger cancelling of file upload
$('#uploadprogresswrapper .stop').on('click', function() {
- Files.cancelUploads();
+ OC.Upload.cancelUploads();
+ procesSelection();
});
// Show trash bin
@@ -393,6 +367,11 @@ $(document).ready(function() {
}
});
}
+
+ //scroll to and highlight preselected file
+ if (getURLParameter('scrollto')) {
+ FileList.scrollTo(getURLParameter('scrollto'));
+ }
});
function scanFiles(force, dir, users){
@@ -534,7 +513,7 @@ var folderDropOptions={
$('#notification').fadeIn();
}
} else {
- OC.dialogs.alert(t('Error moving file'), t('core', 'Error'));
+ OC.dialogs.alert(t('files', 'Error moving file'), t('files', 'Error'));
}
});
});
@@ -572,7 +551,7 @@ var crumbDropOptions={
$('#notification').fadeIn();
}
} else {
- OC.dialogs.alert(t('Error moving file'), t('core', 'Error'));
+ OC.dialogs.alert(t('files', 'Error moving file'), t('files', 'Error'));
}
});
});
@@ -662,15 +641,25 @@ function getPathForPreview(name) {
return path;
}
-function lazyLoadPreview(path, mime, ready) {
- getMimeIcon(mime,ready);
- var x = $('#filestable').data('preview-x');
- var y = $('#filestable').data('preview-y');
- var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:x, y:y});
- $.get(previewURL, function() {
- previewURL = previewURL.replace('(','%28');
- previewURL = previewURL.replace(')','%29');
- ready(previewURL + '&reload=true');
+function lazyLoadPreview(path, mime, ready, width, height) {
+ // get mime icon url
+ getMimeIcon(mime, function(iconURL) {
+ ready(iconURL); // set mimeicon URL
+
+ // now try getting a preview thumbnail URL
+ if ( ! width ) {
+ width = $('#filestable').data('preview-x');
+ }
+ if ( ! height ) {
+ height = $('#filestable').data('preview-y');
+ }
+ var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:width, y:height});
+ $.get(previewURL, function() {
+ previewURL = previewURL.replace('(', '%28');
+ previewURL = previewURL.replace(')', '%29');
+ //set preview thumbnail URL
+ ready(previewURL + '&reload=true');
+ });
});
}
diff --git a/apps/files/js/jquery.fileupload.js b/apps/files/js/jquery.fileupload.js
index a89e9dc2c44..f9f6cc3a382 100644
--- a/apps/files/js/jquery.fileupload.js
+++ b/apps/files/js/jquery.fileupload.js
@@ -1,5 +1,5 @@
/*
- * jQuery File Upload Plugin 5.9
+ * jQuery File Upload Plugin 5.32.2
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
@@ -10,7 +10,7 @@
*/
/*jslint nomen: true, unparam: true, regexp: true */
-/*global define, window, document, Blob, FormData, location */
+/*global define, window, document, location, File, Blob, FormData */
(function (factory) {
'use strict';
@@ -27,12 +27,28 @@
}(function ($) {
'use strict';
+ // Detect file input support, based on
+ // http://viljamis.com/blog/2012/file-upload-support-on-mobile/
+ $.support.fileInput = !(new RegExp(
+ // Handle devices which give false positives for the feature detection:
+ '(Android (1\\.[0156]|2\\.[01]))' +
+ '|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' +
+ '|(w(eb)?OSBrowser)|(webOS)' +
+ '|(Kindle/(1\\.0|2\\.[05]|3\\.0))'
+ ).test(window.navigator.userAgent) ||
+ // Feature detection for all other devices:
+ $('<input type="file">').prop('disabled'));
+
// The FileReader API is not actually used, but works as feature detection,
// as e.g. Safari supports XHR file uploads via the FormData API,
// but not non-multipart XHR file uploads:
$.support.xhrFileUpload = !!(window.XMLHttpRequestUpload && window.FileReader);
$.support.xhrFormDataFileUpload = !!window.FormData;
+ // Detect support for Blob slicing (required for chunked uploads):
+ $.support.blobSlice = window.Blob && (Blob.prototype.slice ||
+ Blob.prototype.webkitSlice || Blob.prototype.mozSlice);
+
// The fileupload widget listens for change events on file input fields defined
// via fileInput setting and paste or drop events of the given dropZone.
// In addition to the default jQuery Widget methods, the fileupload widget
@@ -44,17 +60,16 @@
$.widget('blueimp.fileupload', {
options: {
- // The namespace used for event handler binding on the dropZone and
- // fileInput collections.
- // If not set, the name of the widget ("fileupload") is used.
- namespace: undefined,
- // The drop target collection, by the default the complete document.
- // Set to null or an empty collection to disable drag & drop support:
+ // The drop target element(s), by the default the complete document.
+ // Set to null to disable drag & drop support:
dropZone: $(document),
- // The file input field collection, that is listened for change events.
+ // The paste target element(s), by the default the complete document.
+ // Set to null to disable paste support:
+ pasteZone: $(document),
+ // The file input field(s), that are listened to for change events.
// If undefined, it is set to the file input fields inside
// of the widget element on plugin initialization.
- // Set to null or an empty collection to disable the change listener.
+ // Set to null to disable the change listener.
fileInput: undefined,
// By default, the file input field is replaced with a clone after
// each input field change event. This is required for iframe transport
@@ -63,7 +78,8 @@
replaceFileInput: true,
// The parameter name for the file form data (the request argument name).
// If undefined or empty, the name property of the file input field is
- // used, or "files[]" if the file input name property is also empty:
+ // used, or "files[]" if the file input name property is also empty,
+ // can be a string or an array of strings:
paramName: undefined,
// By default, each file of a selection is uploaded using an individual
// request for XHR type uploads. Set to false to upload file
@@ -108,6 +124,29 @@
// global progress calculation. Set the following option to false to
// prevent recalculating the global progress data:
recalculateProgress: true,
+ // Interval in milliseconds to calculate and trigger progress events:
+ progressInterval: 100,
+ // Interval in milliseconds to calculate progress bitrate:
+ bitrateInterval: 500,
+ // By default, uploads are started automatically when adding files:
+ autoUpload: true,
+
+ // Error and info messages:
+ messages: {
+ uploadedBytes: 'Uploaded bytes exceed file size'
+ },
+
+ // Translation function, gets the message key to be translated
+ // and an object with context specific data as arguments:
+ i18n: function (message, context) {
+ message = this.messages[message] || message.toString();
+ if (context) {
+ $.each(context, function (key, value) {
+ message = message.replace('{' + key + '}', value);
+ });
+ }
+ return message;
+ },
// Additional form data to be sent along with the file uploads can be set
// using this option, which accepts an array of objects with name and
@@ -121,48 +160,81 @@
// The add callback is invoked as soon as files are added to the fileupload
// widget (via file input selection, drag & drop, paste or add API call).
// If the singleFileUploads option is enabled, this callback will be
- // called once for each file in the selection for XHR file uplaods, else
+ // called once for each file in the selection for XHR file uploads, else
// once for each file selection.
+ //
// The upload starts when the submit method is invoked on the data parameter.
// The data object contains a files property holding the added files
- // and allows to override plugin options as well as define ajax settings.
+ // and allows you to override plugin options as well as define ajax settings.
+ //
// Listeners for this callback can also be bound the following way:
// .bind('fileuploadadd', func);
+ //
// data.submit() returns a Promise object and allows to attach additional
// handlers using jQuery's Deferred callbacks:
// data.submit().done(func).fail(func).always(func);
add: function (e, data) {
- data.submit();
+ if (data.autoUpload || (data.autoUpload !== false &&
+ $(this).fileupload('option', 'autoUpload'))) {
+ data.process().done(function () {
+ data.submit();
+ });
+ }
},
// Other callbacks:
+
// Callback for the submit event of each file upload:
// submit: function (e, data) {}, // .bind('fileuploadsubmit', func);
+
// Callback for the start of each file upload request:
// send: function (e, data) {}, // .bind('fileuploadsend', func);
+
// Callback for successful uploads:
// done: function (e, data) {}, // .bind('fileuploaddone', func);
+
// Callback for failed (abort or error) uploads:
// fail: function (e, data) {}, // .bind('fileuploadfail', func);
+
// Callback for completed (success, abort or error) requests:
// always: function (e, data) {}, // .bind('fileuploadalways', func);
+
// Callback for upload progress events:
// progress: function (e, data) {}, // .bind('fileuploadprogress', func);
+
// Callback for global upload progress events:
// progressall: function (e, data) {}, // .bind('fileuploadprogressall', func);
+
// Callback for uploads start, equivalent to the global ajaxStart event:
// start: function (e) {}, // .bind('fileuploadstart', func);
+
// Callback for uploads stop, equivalent to the global ajaxStop event:
// stop: function (e) {}, // .bind('fileuploadstop', func);
- // Callback for change events of the fileInput collection:
+
+ // Callback for change events of the fileInput(s):
// change: function (e, data) {}, // .bind('fileuploadchange', func);
- // Callback for paste events to the dropZone collection:
+
+ // Callback for paste events to the pasteZone(s):
// paste: function (e, data) {}, // .bind('fileuploadpaste', func);
- // Callback for drop events of the dropZone collection:
+
+ // Callback for drop events of the dropZone(s):
// drop: function (e, data) {}, // .bind('fileuploaddrop', func);
- // Callback for dragover events of the dropZone collection:
+
+ // Callback for dragover events of the dropZone(s):
// dragover: function (e) {}, // .bind('fileuploaddragover', func);
+ // Callback for the start of each chunk upload request:
+ // chunksend: function (e, data) {}, // .bind('fileuploadchunksend', func);
+
+ // Callback for successful chunk uploads:
+ // chunkdone: function (e, data) {}, // .bind('fileuploadchunkdone', func);
+
+ // Callback for failed (abort or error) chunk uploads:
+ // chunkfail: function (e, data) {}, // .bind('fileuploadchunkfail', func);
+
+ // Callback for completed (success, abort or error) chunk upload requests:
+ // chunkalways: function (e, data) {}, // .bind('fileuploadchunkalways', func);
+
// The plugin options are used as settings object for the ajax calls.
// The following are jQuery ajax settings required for the file uploads:
processData: false,
@@ -170,15 +242,36 @@
cache: false
},
- // A list of options that require a refresh after assigning a new value:
- _refreshOptionsList: [
- 'namespace',
- 'dropZone',
+ // A list of options that require reinitializing event listeners and/or
+ // special initialization code:
+ _specialOptions: [
'fileInput',
+ 'dropZone',
+ 'pasteZone',
'multipart',
'forceIframeTransport'
],
+ _blobSlice: $.support.blobSlice && function () {
+ var slice = this.slice || this.webkitSlice || this.mozSlice;
+ return slice.apply(this, arguments);
+ },
+
+ _BitrateTimer: function () {
+ this.timestamp = ((Date.now) ? Date.now() : (new Date()).getTime());
+ this.loaded = 0;
+ this.bitrate = 0;
+ this.getBitrate = function (now, loaded, interval) {
+ var timeDiff = now - this.timestamp;
+ if (!this.bitrate || !interval || timeDiff > interval) {
+ this.bitrate = (loaded - this.loaded) * (1000 / timeDiff) * 8;
+ this.loaded = loaded;
+ this.timestamp = now;
+ }
+ return this.bitrate;
+ };
+ },
+
_isXHRUpload: function (options) {
return !options.forceIframeTransport &&
((!options.multipart && $.support.xhrFileUpload) ||
@@ -189,9 +282,11 @@
var formData;
if (typeof options.formData === 'function') {
return options.formData(options.form);
- } else if ($.isArray(options.formData)) {
+ }
+ if ($.isArray(options.formData)) {
return options.formData;
- } else if (options.formData) {
+ }
+ if ($.type(options.formData) === 'object') {
formData = [];
$.each(options.formData, function (name, value) {
formData.push({name: name, value: value});
@@ -209,28 +304,66 @@
return total;
},
+ _initProgressObject: function (obj) {
+ var progress = {
+ loaded: 0,
+ total: 0,
+ bitrate: 0
+ };
+ if (obj._progress) {
+ $.extend(obj._progress, progress);
+ } else {
+ obj._progress = progress;
+ }
+ },
+
+ _initResponseObject: function (obj) {
+ var prop;
+ if (obj._response) {
+ for (prop in obj._response) {
+ if (obj._response.hasOwnProperty(prop)) {
+ delete obj._response[prop];
+ }
+ }
+ } else {
+ obj._response = {};
+ }
+ },
+
_onProgress: function (e, data) {
if (e.lengthComputable) {
- var total = data.total || this._getTotal(data.files),
- loaded = parseInt(
- e.loaded / e.total * (data.chunkSize || total),
- 10
- ) + (data.uploadedBytes || 0);
- this._loaded += loaded - (data.loaded || data.uploadedBytes || 0);
- data.lengthComputable = true;
- data.loaded = loaded;
- data.total = total;
+ var now = ((Date.now) ? Date.now() : (new Date()).getTime()),
+ loaded;
+ if (data._time && data.progressInterval &&
+ (now - data._time < data.progressInterval) &&
+ e.loaded !== e.total) {
+ return;
+ }
+ data._time = now;
+ loaded = Math.floor(
+ e.loaded / e.total * (data.chunkSize || data._progress.total)
+ ) + (data.uploadedBytes || 0);
+ // Add the difference from the previously loaded state
+ // to the global loaded counter:
+ this._progress.loaded += (loaded - data._progress.loaded);
+ this._progress.bitrate = this._bitrateTimer.getBitrate(
+ now,
+ this._progress.loaded,
+ data.bitrateInterval
+ );
+ data._progress.loaded = data.loaded = loaded;
+ data._progress.bitrate = data.bitrate = data._bitrateTimer.getBitrate(
+ now,
+ loaded,
+ data.bitrateInterval
+ );
// Trigger a custom progress event with a total data property set
// to the file size(s) of the current upload and a loaded data
// property calculated accordingly:
this._trigger('progress', e, data);
// Trigger a global progress event for all current file uploads,
// including ajax calls queued for sequential file uploads:
- this._trigger('progressall', e, {
- lengthComputable: true,
- loaded: this._loaded,
- total: this._total
- });
+ this._trigger('progressall', e, this._progress);
}
},
@@ -254,34 +387,30 @@
}
},
+ _isInstanceOf: function (type, obj) {
+ // Cross-frame instanceof check
+ return Object.prototype.toString.call(obj) === '[object ' + type + ']';
+ },
+
_initXHRData: function (options) {
- var formData,
+ var that = this,
+ formData,
file = options.files[0],
// Ignore non-multipart setting if not supported:
- multipart = options.multipart || !$.support.xhrFileUpload;
- if (!multipart || options.blob) {
- // For non-multipart uploads and chunked uploads,
- // file meta data is not part of the request body,
- // so we transmit this data as part of the HTTP headers.
- // For cross domain requests, these headers must be allowed
- // via Access-Control-Allow-Headers or removed using
- // the beforeSend callback:
- options.headers = $.extend(options.headers, {
- 'X-File-Name': file.name,
- 'X-File-Type': file.type,
- 'X-File-Size': file.size
- });
- if (!options.blob) {
- // Non-chunked non-multipart upload:
- options.contentType = file.type;
- options.data = file;
- } else if (!multipart) {
- // Chunked non-multipart upload:
- options.contentType = 'application/octet-stream';
- options.data = options.blob;
- }
+ multipart = options.multipart || !$.support.xhrFileUpload,
+ paramName = options.paramName[0];
+ options.headers = options.headers || {};
+ if (options.contentRange) {
+ options.headers['Content-Range'] = options.contentRange;
+ }
+ if (!multipart || options.blob || !this._isInstanceOf('File', file)) {
+ options.headers['Content-Disposition'] = 'attachment; filename="' +
+ encodeURI(file.name) + '"';
}
- if (multipart && $.support.xhrFormDataFileUpload) {
+ if (!multipart) {
+ options.contentType = file.type;
+ options.data = options.blob || file;
+ } else if ($.support.xhrFormDataFileUpload) {
if (options.postMessage) {
// window.postMessage does not allow sending FormData
// objects, so we just add the File/Blob objects to
@@ -290,19 +419,19 @@
formData = this._getFormData(options);
if (options.blob) {
formData.push({
- name: options.paramName,
+ name: paramName,
value: options.blob
});
} else {
$.each(options.files, function (index, file) {
formData.push({
- name: options.paramName,
+ name: options.paramName[index] || paramName,
value: file
});
});
}
} else {
- if (options.formData instanceof FormData) {
+ if (that._isInstanceOf('FormData', options.formData)) {
formData = options.formData;
} else {
formData = new FormData();
@@ -311,14 +440,18 @@
});
}
if (options.blob) {
- formData.append(options.paramName, options.blob, file.name);
+ formData.append(paramName, options.blob, file.name);
} else {
$.each(options.files, function (index, file) {
- // File objects are also Blob instances.
// This check allows the tests to run with
// dummy objects:
- if (file instanceof Blob) {
- formData.append(options.paramName, file, file.name);
+ if (that._isInstanceOf('File', file) ||
+ that._isInstanceOf('Blob', file)) {
+ formData.append(
+ options.paramName[index] || paramName,
+ file,
+ file.name
+ );
}
});
}
@@ -330,13 +463,13 @@
},
_initIframeSettings: function (options) {
+ var targetHost = $('<a></a>').prop('href', options.url).prop('host');
// Setting the dataType to iframe enables the iframe transport:
options.dataType = 'iframe ' + (options.dataType || '');
// The iframe transport accepts a serialized array as form data:
options.formData = this._getFormData(options);
// Add redirect url to form data on cross-domain uploads:
- if (options.redirect && $('<a></a>').prop('href', options.url)
- .prop('host') !== location.host) {
+ if (options.redirect && targetHost && targetHost !== location.host) {
options.formData.push({
name: options.redirectParamName || 'redirect',
value: options.redirect
@@ -358,29 +491,58 @@
options.dataType = 'postmessage ' + (options.dataType || '');
}
} else {
- this._initIframeSettings(options, 'iframe');
+ this._initIframeSettings(options);
}
},
+ _getParamName: function (options) {
+ var fileInput = $(options.fileInput),
+ paramName = options.paramName;
+ if (!paramName) {
+ paramName = [];
+ fileInput.each(function () {
+ var input = $(this),
+ name = input.prop('name') || 'files[]',
+ i = (input.prop('files') || [1]).length;
+ while (i) {
+ paramName.push(name);
+ i -= 1;
+ }
+ });
+ if (!paramName.length) {
+ paramName = [fileInput.prop('name') || 'files[]'];
+ }
+ } else if (!$.isArray(paramName)) {
+ paramName = [paramName];
+ }
+ return paramName;
+ },
+
_initFormSettings: function (options) {
// Retrieve missing options from the input field and the
// associated form, if available:
if (!options.form || !options.form.length) {
options.form = $(options.fileInput.prop('form'));
+ // If the given file input doesn't have an associated form,
+ // use the default widget file input's form:
+ if (!options.form.length) {
+ options.form = $(this.options.fileInput.prop('form'));
+ }
}
- if (!options.paramName) {
- options.paramName = options.fileInput.prop('name') ||
- 'files[]';
- }
+ options.paramName = this._getParamName(options);
if (!options.url) {
options.url = options.form.prop('action') || location.href;
}
// The HTTP request method must be "POST" or "PUT":
options.type = (options.type || options.form.prop('method') || '')
.toUpperCase();
- if (options.type !== 'POST' && options.type !== 'PUT') {
+ if (options.type !== 'POST' && options.type !== 'PUT' &&
+ options.type !== 'PATCH') {
options.type = 'POST';
}
+ if (!options.formAcceptCharset) {
+ options.formAcceptCharset = options.form.attr('accept-charset');
+ }
},
_getAJAXSettings: function (data) {
@@ -390,6 +552,21 @@
return options;
},
+ // jQuery 1.6 doesn't provide .state(),
+ // while jQuery 1.8+ removed .isRejected() and .isResolved():
+ _getDeferredState: function (deferred) {
+ if (deferred.state) {
+ return deferred.state();
+ }
+ if (deferred.isResolved()) {
+ return 'resolved';
+ }
+ if (deferred.isRejected()) {
+ return 'rejected';
+ }
+ return 'pending';
+ },
+
// Maps jqXHR callbacks to the equivalent
// methods of the given Promise object:
_enhancePromise: function (promise) {
@@ -414,24 +591,77 @@
return this._enhancePromise(promise);
},
+ // Adds convenience methods to the data callback argument:
+ _addConvenienceMethods: function (e, data) {
+ var that = this,
+ getPromise = function (data) {
+ return $.Deferred().resolveWith(that, [data]).promise();
+ };
+ data.process = function (resolveFunc, rejectFunc) {
+ if (resolveFunc || rejectFunc) {
+ data._processQueue = this._processQueue =
+ (this._processQueue || getPromise(this))
+ .pipe(resolveFunc, rejectFunc);
+ }
+ return this._processQueue || getPromise(this);
+ };
+ data.submit = function () {
+ if (this.state() !== 'pending') {
+ data.jqXHR = this.jqXHR =
+ (that._trigger('submit', e, this) !== false) &&
+ that._onSend(e, this);
+ }
+ return this.jqXHR || that._getXHRPromise();
+ };
+ data.abort = function () {
+ if (this.jqXHR) {
+ return this.jqXHR.abort();
+ }
+ return that._getXHRPromise();
+ };
+ data.state = function () {
+ if (this.jqXHR) {
+ return that._getDeferredState(this.jqXHR);
+ }
+ if (this._processQueue) {
+ return that._getDeferredState(this._processQueue);
+ }
+ };
+ data.progress = function () {
+ return this._progress;
+ };
+ data.response = function () {
+ return this._response;
+ };
+ },
+
+ // Parses the Range header from the server response
+ // and returns the uploaded bytes:
+ _getUploadedBytes: function (jqXHR) {
+ var range = jqXHR.getResponseHeader('Range'),
+ parts = range && range.split('-'),
+ upperBytesPos = parts && parts.length > 1 &&
+ parseInt(parts[1], 10);
+ return upperBytesPos && upperBytesPos + 1;
+ },
+
// Uploads a file in multiple, sequential requests
// by splitting the file up in multiple blob chunks.
// If the second parameter is true, only tests if the file
// should be uploaded in chunks, but does not invoke any
// upload requests:
_chunkedUpload: function (options, testOnly) {
+ options.uploadedBytes = options.uploadedBytes || 0;
var that = this,
file = options.files[0],
fs = file.size,
- ub = options.uploadedBytes = options.uploadedBytes || 0,
+ ub = options.uploadedBytes,
mcs = options.maxChunkSize || fs,
- // Use the Blob methods with the slice implementation
- // according to the W3C Blob API specification:
- slice = file.webkitSlice || file.mozSlice || file.slice,
- upload,
- n,
+ slice = this._blobSlice,
+ dfd = $.Deferred(),
+ promise = dfd.promise(),
jqXHR,
- pipe;
+ upload;
if (!(this._isXHRUpload(options) && slice && (ub || mcs < fs)) ||
options.data) {
return false;
@@ -440,62 +670,84 @@
return true;
}
if (ub >= fs) {
- file.error = 'uploadedBytes';
+ file.error = options.i18n('uploadedBytes');
return this._getXHRPromise(
false,
options.context,
[null, 'error', file.error]
);
}
- // n is the number of blobs to upload,
- // calculated via filesize, uploaded bytes and max chunk size:
- n = Math.ceil((fs - ub) / mcs);
- // The chunk upload method accepting the chunk number as parameter:
- upload = function (i) {
- if (!i) {
- return that._getXHRPromise(true, options.context);
- }
- // Upload the blobs in sequential order:
- return upload(i -= 1).pipe(function () {
- // Clone the options object for each chunk upload:
- var o = $.extend({}, options);
- o.blob = slice.call(
- file,
- ub + i * mcs,
- ub + (i + 1) * mcs
- );
- // Store the current chunk size, as the blob itself
- // will be dereferenced after data processing:
- o.chunkSize = o.blob.size;
- // Process the upload data (the blob and potential form data):
- that._initXHRData(o);
- // Add progress listeners for this chunk upload:
- that._initProgressListener(o);
- jqXHR = ($.ajax(o) || that._getXHRPromise(false, o.context))
- .done(function () {
- // Create a progress event if upload is done and
- // no progress event has been invoked for this chunk:
- if (!o.loaded) {
- that._onProgress($.Event('progress', {
- lengthComputable: true,
- loaded: o.chunkSize,
- total: o.chunkSize
- }), o);
- }
- options.uploadedBytes = o.uploadedBytes +=
- o.chunkSize;
- });
- return jqXHR;
- });
+ // The chunk upload method:
+ upload = function () {
+ // Clone the options object for each chunk upload:
+ var o = $.extend({}, options),
+ currentLoaded = o._progress.loaded;
+ o.blob = slice.call(
+ file,
+ ub,
+ ub + mcs,
+ file.type
+ );
+ // Store the current chunk size, as the blob itself
+ // will be dereferenced after data processing:
+ o.chunkSize = o.blob.size;
+ // Expose the chunk bytes position range:
+ o.contentRange = 'bytes ' + ub + '-' +
+ (ub + o.chunkSize - 1) + '/' + fs;
+ // Process the upload data (the blob and potential form data):
+ that._initXHRData(o);
+ // Add progress listeners for this chunk upload:
+ that._initProgressListener(o);
+ jqXHR = ((that._trigger('chunksend', null, o) !== false && $.ajax(o)) ||
+ that._getXHRPromise(false, o.context))
+ .done(function (result, textStatus, jqXHR) {
+ ub = that._getUploadedBytes(jqXHR) ||
+ (ub + o.chunkSize);
+ // Create a progress event if no final progress event
+ // with loaded equaling total has been triggered
+ // for this chunk:
+ if (currentLoaded + o.chunkSize - o._progress.loaded) {
+ that._onProgress($.Event('progress', {
+ lengthComputable: true,
+ loaded: ub - o.uploadedBytes,
+ total: ub - o.uploadedBytes
+ }), o);
+ }
+ options.uploadedBytes = o.uploadedBytes = ub;
+ o.result = result;
+ o.textStatus = textStatus;
+ o.jqXHR = jqXHR;
+ that._trigger('chunkdone', null, o);
+ that._trigger('chunkalways', null, o);
+ if (ub < fs) {
+ // File upload not yet complete,
+ // continue with the next chunk:
+ upload();
+ } else {
+ dfd.resolveWith(
+ o.context,
+ [result, textStatus, jqXHR]
+ );
+ }
+ })
+ .fail(function (jqXHR, textStatus, errorThrown) {
+ o.jqXHR = jqXHR;
+ o.textStatus = textStatus;
+ o.errorThrown = errorThrown;
+ that._trigger('chunkfail', null, o);
+ that._trigger('chunkalways', null, o);
+ dfd.rejectWith(
+ o.context,
+ [jqXHR, textStatus, errorThrown]
+ );
+ });
};
- // Return the piped Promise object, enhanced with an abort method,
- // which is delegated to the jqXHR object of the current upload,
- // and jqXHR callbacks mapped to the equivalent Promise methods:
- pipe = upload(n);
- pipe.abort = function () {
+ this._enhancePromise(promise);
+ promise.abort = function () {
return jqXHR.abort();
};
- return this._enhancePromise(pipe);
+ upload();
+ return promise;
},
_beforeSend: function (e, data) {
@@ -504,99 +756,113 @@
// and no other uploads are currently running,
// equivalent to the global ajaxStart event:
this._trigger('start');
+ // Set timer for global bitrate progress calculation:
+ this._bitrateTimer = new this._BitrateTimer();
+ // Reset the global progress values:
+ this._progress.loaded = this._progress.total = 0;
+ this._progress.bitrate = 0;
}
+ // Make sure the container objects for the .response() and
+ // .progress() methods on the data object are available
+ // and reset to their initial state:
+ this._initResponseObject(data);
+ this._initProgressObject(data);
+ data._progress.loaded = data.loaded = data.uploadedBytes || 0;
+ data._progress.total = data.total = this._getTotal(data.files) || 1;
+ data._progress.bitrate = data.bitrate = 0;
this._active += 1;
// Initialize the global progress values:
- this._loaded += data.uploadedBytes || 0;
- this._total += this._getTotal(data.files);
+ this._progress.loaded += data.loaded;
+ this._progress.total += data.total;
},
_onDone: function (result, textStatus, jqXHR, options) {
- if (!this._isXHRUpload(options)) {
- // Create a progress event for each iframe load:
+ var total = options._progress.total,
+ response = options._response;
+ if (options._progress.loaded < total) {
+ // Create a progress event if no final progress event
+ // with loaded equaling total has been triggered:
this._onProgress($.Event('progress', {
lengthComputable: true,
- loaded: 1,
- total: 1
+ loaded: total,
+ total: total
}), options);
}
- options.result = result;
- options.textStatus = textStatus;
- options.jqXHR = jqXHR;
+ response.result = options.result = result;
+ response.textStatus = options.textStatus = textStatus;
+ response.jqXHR = options.jqXHR = jqXHR;
this._trigger('done', null, options);
},
_onFail: function (jqXHR, textStatus, errorThrown, options) {
- options.jqXHR = jqXHR;
- options.textStatus = textStatus;
- options.errorThrown = errorThrown;
- this._trigger('fail', null, options);
+ var response = options._response;
if (options.recalculateProgress) {
// Remove the failed (error or abort) file upload from
// the global progress calculation:
- this._loaded -= options.loaded || options.uploadedBytes || 0;
- this._total -= options.total || this._getTotal(options.files);
+ this._progress.loaded -= options._progress.loaded;
+ this._progress.total -= options._progress.total;
}
+ response.jqXHR = options.jqXHR = jqXHR;
+ response.textStatus = options.textStatus = textStatus;
+ response.errorThrown = options.errorThrown = errorThrown;
+ this._trigger('fail', null, options);
},
_onAlways: function (jqXHRorResult, textStatus, jqXHRorError, options) {
- this._active -= 1;
- options.textStatus = textStatus;
- if (jqXHRorError && jqXHRorError.always) {
- options.jqXHR = jqXHRorError;
- options.result = jqXHRorResult;
- } else {
- options.jqXHR = jqXHRorResult;
- options.errorThrown = jqXHRorError;
- }
+ // jqXHRorResult, textStatus and jqXHRorError are added to the
+ // options object via done and fail callbacks
this._trigger('always', null, options);
- if (this._active === 0) {
- // The stop callback is triggered when all uploads have
- // been completed, equivalent to the global ajaxStop event:
- this._trigger('stop');
- // Reset the global progress values:
- this._loaded = this._total = 0;
- }
},
_onSend: function (e, data) {
+ if (!data.submit) {
+ this._addConvenienceMethods(e, data);
+ }
var that = this,
jqXHR,
+ aborted,
slot,
pipe,
options = that._getAJAXSettings(data),
- send = function (resolve, args) {
+ send = function () {
that._sending += 1;
+ // Set timer for bitrate progress calculation:
+ options._bitrateTimer = new that._BitrateTimer();
jqXHR = jqXHR || (
- (resolve !== false &&
- that._trigger('send', e, options) !== false &&
- (that._chunkedUpload(options) || $.ajax(options))) ||
- that._getXHRPromise(false, options.context, args)
+ ((aborted || that._trigger('send', e, options) === false) &&
+ that._getXHRPromise(false, options.context, aborted)) ||
+ that._chunkedUpload(options) || $.ajax(options)
).done(function (result, textStatus, jqXHR) {
that._onDone(result, textStatus, jqXHR, options);
}).fail(function (jqXHR, textStatus, errorThrown) {
that._onFail(jqXHR, textStatus, errorThrown, options);
}).always(function (jqXHRorResult, textStatus, jqXHRorError) {
- that._sending -= 1;
that._onAlways(
jqXHRorResult,
textStatus,
jqXHRorError,
options
);
+ that._sending -= 1;
+ that._active -= 1;
if (options.limitConcurrentUploads &&
options.limitConcurrentUploads > that._sending) {
// Start the next queued upload,
// that has not been aborted:
var nextSlot = that._slots.shift();
while (nextSlot) {
- if (!nextSlot.isRejected()) {
+ if (that._getDeferredState(nextSlot) === 'pending') {
nextSlot.resolve();
break;
}
nextSlot = that._slots.shift();
}
}
+ if (that._active === 0) {
+ // The stop callback is triggered when all uploads have
+ // been completed, equivalent to the global ajaxStop event:
+ that._trigger('stop');
+ }
});
return jqXHR;
};
@@ -609,18 +875,19 @@
this._slots.push(slot);
pipe = slot.pipe(send);
} else {
- pipe = (this._sequence = this._sequence.pipe(send, send));
+ this._sequence = this._sequence.pipe(send, send);
+ pipe = this._sequence;
}
// Return the piped Promise object, enhanced with an abort method,
// which is delegated to the jqXHR object of the current upload,
// and jqXHR callbacks mapped to the equivalent Promise methods:
pipe.abort = function () {
- var args = [undefined, 'abort', 'abort'];
+ aborted = [undefined, 'abort', 'abort'];
if (!jqXHR) {
if (slot) {
- slot.rejectWith(args);
+ slot.rejectWith(options.context, aborted);
}
- return send(false, args);
+ return send();
}
return jqXHR.abort();
};
@@ -634,40 +901,43 @@
result = true,
options = $.extend({}, this.options, data),
limit = options.limitMultiFileUploads,
+ paramName = this._getParamName(options),
+ paramNameSet,
+ paramNameSlice,
fileSet,
i;
if (!(options.singleFileUploads || limit) ||
!this._isXHRUpload(options)) {
fileSet = [data.files];
+ paramNameSet = [paramName];
} else if (!options.singleFileUploads && limit) {
fileSet = [];
+ paramNameSet = [];
for (i = 0; i < data.files.length; i += limit) {
fileSet.push(data.files.slice(i, i + limit));
+ paramNameSlice = paramName.slice(i, i + limit);
+ if (!paramNameSlice.length) {
+ paramNameSlice = paramName;
+ }
+ paramNameSet.push(paramNameSlice);
}
+ } else {
+ paramNameSet = paramName;
}
data.originalFiles = data.files;
$.each(fileSet || data.files, function (index, element) {
- var files = fileSet ? element : [element],
- newData = $.extend({}, data, {files: files});
- newData.submit = function () {
- newData.jqXHR = this.jqXHR =
- (that._trigger('submit', e, this) !== false) &&
- that._onSend(e, this);
- return this.jqXHR;
- };
- return (result = that._trigger('add', e, newData));
+ var newData = $.extend({}, data);
+ newData.files = fileSet ? element : [element];
+ newData.paramName = paramNameSet[index];
+ that._initResponseObject(newData);
+ that._initProgressObject(newData);
+ that._addConvenienceMethods(e, newData);
+ result = that._trigger('add', e, newData);
+ return result;
});
return result;
},
- // File Normalization for Gecko 1.9.1 (Firefox 3.5) support:
- _normalizeFile: function (index, file) {
- if (file.name === undefined && file.size === undefined) {
- file.name = file.fileName;
- file.size = file.fileSize;
- }
- },
-
_replaceFileInput: function (input) {
var inputClone = input.clone(true);
$('<form></form>').append(inputClone)[0].reset();
@@ -677,7 +947,7 @@
// Avoid memory leaks with the detached file input:
$.cleanData(input.unbind('remove'));
// Replace the original file input element in the fileInput
- // collection with the clone, which has been copied including
+ // elements set with the clone, which has been copied including
// event handlers:
this.options.fileInput = this.options.fileInput.map(function (i, el) {
if (el === input[0]) {
@@ -692,102 +962,229 @@
}
},
- _onChange: function (e) {
- var that = e.data.fileupload,
- data = {
- files: $.each($.makeArray(e.target.files), that._normalizeFile),
- fileInput: $(e.target),
- form: $(e.target.form)
- };
- if (!data.files.length) {
+ _handleFileTreeEntry: function (entry, path) {
+ var that = this,
+ dfd = $.Deferred(),
+ errorHandler = function (e) {
+ if (e && !e.entry) {
+ e.entry = entry;
+ }
+ // Since $.when returns immediately if one
+ // Deferred is rejected, we use resolve instead.
+ // This allows valid files and invalid items
+ // to be returned together in one set:
+ dfd.resolve([e]);
+ },
+ dirReader;
+ path = path || '';
+ if (entry.isFile) {
+ if (entry._file) {
+ // Workaround for Chrome bug #149735
+ entry._file.relativePath = path;
+ dfd.resolve(entry._file);
+ } else {
+ entry.file(function (file) {
+ file.relativePath = path;
+ dfd.resolve(file);
+ }, errorHandler);
+ }
+ } else if (entry.isDirectory) {
+ dirReader = entry.createReader();
+ dirReader.readEntries(function (entries) {
+ that._handleFileTreeEntries(
+ entries,
+ path + entry.name + '/'
+ ).done(function (files) {
+ dfd.resolve(files);
+ }).fail(errorHandler);
+ }, errorHandler);
+ } else {
+ // Return an empy list for file system items
+ // other than files or directories:
+ dfd.resolve([]);
+ }
+ return dfd.promise();
+ },
+
+ _handleFileTreeEntries: function (entries, path) {
+ var that = this;
+ return $.when.apply(
+ $,
+ $.map(entries, function (entry) {
+ return that._handleFileTreeEntry(entry, path);
+ })
+ ).pipe(function () {
+ return Array.prototype.concat.apply(
+ [],
+ arguments
+ );
+ });
+ },
+
+ _getDroppedFiles: function (dataTransfer) {
+ dataTransfer = dataTransfer || {};
+ var items = dataTransfer.items;
+ if (items && items.length && (items[0].webkitGetAsEntry ||
+ items[0].getAsEntry)) {
+ return this._handleFileTreeEntries(
+ $.map(items, function (item) {
+ var entry;
+ if (item.webkitGetAsEntry) {
+ entry = item.webkitGetAsEntry();
+ if (entry) {
+ // Workaround for Chrome bug #149735:
+ entry._file = item.getAsFile();
+ }
+ return entry;
+ }
+ return item.getAsEntry();
+ })
+ );
+ }
+ return $.Deferred().resolve(
+ $.makeArray(dataTransfer.files)
+ ).promise();
+ },
+
+ _getSingleFileInputFiles: function (fileInput) {
+ fileInput = $(fileInput);
+ var entries = fileInput.prop('webkitEntries') ||
+ fileInput.prop('entries'),
+ files,
+ value;
+ if (entries && entries.length) {
+ return this._handleFileTreeEntries(entries);
+ }
+ files = $.makeArray(fileInput.prop('files'));
+ if (!files.length) {
+ value = fileInput.prop('value');
+ if (!value) {
+ return $.Deferred().resolve([]).promise();
+ }
// If the files property is not available, the browser does not
// support the File API and we add a pseudo File object with
// the input value as name with path information removed:
- data.files = [{name: e.target.value.replace(/^.*\\/, '')}];
- }
- if (that.options.replaceFileInput) {
- that._replaceFileInput(data.fileInput);
+ files = [{name: value.replace(/^.*\\/, '')}];
+ } else if (files[0].name === undefined && files[0].fileName) {
+ // File normalization for Safari 4 and Firefox 3:
+ $.each(files, function (index, file) {
+ file.name = file.fileName;
+ file.size = file.fileSize;
+ });
}
- if (that._trigger('change', e, data) === false ||
- that._onAdd(e, data) === false) {
- return false;
+ return $.Deferred().resolve(files).promise();
+ },
+
+ _getFileInputFiles: function (fileInput) {
+ if (!(fileInput instanceof $) || fileInput.length === 1) {
+ return this._getSingleFileInputFiles(fileInput);
}
+ return $.when.apply(
+ $,
+ $.map(fileInput, this._getSingleFileInputFiles)
+ ).pipe(function () {
+ return Array.prototype.concat.apply(
+ [],
+ arguments
+ );
+ });
+ },
+
+ _onChange: function (e) {
+ var that = this,
+ data = {
+ fileInput: $(e.target),
+ form: $(e.target.form)
+ };
+ this._getFileInputFiles(data.fileInput).always(function (files) {
+ data.files = files;
+ if (that.options.replaceFileInput) {
+ that._replaceFileInput(data.fileInput);
+ }
+ if (that._trigger('change', e, data) !== false) {
+ that._onAdd(e, data);
+ }
+ });
},
_onPaste: function (e) {
- var that = e.data.fileupload,
- cbd = e.originalEvent.clipboardData,
- items = (cbd && cbd.items) || [],
+ var items = e.originalEvent && e.originalEvent.clipboardData &&
+ e.originalEvent.clipboardData.items,
data = {files: []};
- $.each(items, function (index, item) {
- var file = item.getAsFile && item.getAsFile();
- if (file) {
- data.files.push(file);
+ if (items && items.length) {
+ $.each(items, function (index, item) {
+ var file = item.getAsFile && item.getAsFile();
+ if (file) {
+ data.files.push(file);
+ }
+ });
+ if (this._trigger('paste', e, data) === false ||
+ this._onAdd(e, data) === false) {
+ return false;
}
- });
- if (that._trigger('paste', e, data) === false ||
- that._onAdd(e, data) === false) {
- return false;
}
},
_onDrop: function (e) {
- var that = e.data.fileupload,
- dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer,
- data = {
- files: $.each(
- $.makeArray(dataTransfer && dataTransfer.files),
- that._normalizeFile
- )
- };
- if (that._trigger('drop', e, data) === false ||
- that._onAdd(e, data) === false) {
- return false;
+ e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
+ var that = this,
+ dataTransfer = e.dataTransfer,
+ data = {};
+ if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {
+ e.preventDefault();
+ this._getDroppedFiles(dataTransfer).always(function (files) {
+ data.files = files;
+ if (that._trigger('drop', e, data) !== false) {
+ that._onAdd(e, data);
+ }
+ });
}
- e.preventDefault();
},
_onDragOver: function (e) {
- var that = e.data.fileupload,
- dataTransfer = e.dataTransfer = e.originalEvent.dataTransfer;
- if (that._trigger('dragover', e) === false) {
- return false;
- }
+ e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
+ var dataTransfer = e.dataTransfer;
if (dataTransfer) {
- dataTransfer.dropEffect = dataTransfer.effectAllowed = 'copy';
+ if (this._trigger('dragover', e) === false) {
+ return false;
+ }
+ if ($.inArray('Files', dataTransfer.types) !== -1) {
+ dataTransfer.dropEffect = 'copy';
+ e.preventDefault();
+ }
}
- e.preventDefault();
},
_initEventHandlers: function () {
- var ns = this.options.namespace;
if (this._isXHRUpload(this.options)) {
- this.options.dropZone
- .bind('dragover.' + ns, {fileupload: this}, this._onDragOver)
- .bind('drop.' + ns, {fileupload: this}, this._onDrop)
- .bind('paste.' + ns, {fileupload: this}, this._onPaste);
+ this._on(this.options.dropZone, {
+ dragover: this._onDragOver,
+ drop: this._onDrop
+ });
+ this._on(this.options.pasteZone, {
+ paste: this._onPaste
+ });
+ }
+ if ($.support.fileInput) {
+ this._on(this.options.fileInput, {
+ change: this._onChange
+ });
}
- this.options.fileInput
- .bind('change.' + ns, {fileupload: this}, this._onChange);
},
_destroyEventHandlers: function () {
- var ns = this.options.namespace;
- this.options.dropZone
- .unbind('dragover.' + ns, this._onDragOver)
- .unbind('drop.' + ns, this._onDrop)
- .unbind('paste.' + ns, this._onPaste);
- this.options.fileInput
- .unbind('change.' + ns, this._onChange);
+ this._off(this.options.dropZone, 'dragover drop');
+ this._off(this.options.pasteZone, 'paste');
+ this._off(this.options.fileInput, 'change');
},
_setOption: function (key, value) {
- var refresh = $.inArray(key, this._refreshOptionsList) !== -1;
- if (refresh) {
+ var reinit = $.inArray(key, this._specialOptions) !== -1;
+ if (reinit) {
this._destroyEventHandlers();
}
- $.Widget.prototype._setOption.call(this, key, value);
- if (refresh) {
+ this._super(key, value);
+ if (reinit) {
this._initSpecialOptions();
this._initEventHandlers();
}
@@ -796,42 +1193,68 @@
_initSpecialOptions: function () {
var options = this.options;
if (options.fileInput === undefined) {
- options.fileInput = this.element.is('input:file') ?
- this.element : this.element.find('input:file');
+ options.fileInput = this.element.is('input[type="file"]') ?
+ this.element : this.element.find('input[type="file"]');
} else if (!(options.fileInput instanceof $)) {
options.fileInput = $(options.fileInput);
}
if (!(options.dropZone instanceof $)) {
options.dropZone = $(options.dropZone);
}
+ if (!(options.pasteZone instanceof $)) {
+ options.pasteZone = $(options.pasteZone);
+ }
+ },
+
+ _getRegExp: function (str) {
+ var parts = str.split('/'),
+ modifiers = parts.pop();
+ parts.shift();
+ return new RegExp(parts.join('/'), modifiers);
+ },
+
+ _isRegExpOption: function (key, value) {
+ return key !== 'url' && $.type(value) === 'string' &&
+ /^\/.*\/[igm]{0,3}$/.test(value);
+ },
+
+ _initDataAttributes: function () {
+ var that = this,
+ options = this.options;
+ // Initialize options set via HTML5 data-attributes:
+ $.each(
+ $(this.element[0].cloneNode(false)).data(),
+ function (key, value) {
+ if (that._isRegExpOption(key, value)) {
+ value = that._getRegExp(value);
+ }
+ options[key] = value;
+ }
+ );
},
_create: function () {
- var options = this.options,
- dataOpts = $.extend({}, this.element.data());
- dataOpts[this.widgetName] = undefined;
- $.extend(options, dataOpts);
- options.namespace = options.namespace || this.widgetName;
+ this._initDataAttributes();
this._initSpecialOptions();
this._slots = [];
this._sequence = this._getXHRPromise(true);
- this._sending = this._active = this._loaded = this._total = 0;
+ this._sending = this._active = 0;
+ this._initProgressObject(this);
this._initEventHandlers();
},
- destroy: function () {
- this._destroyEventHandlers();
- $.Widget.prototype.destroy.call(this);
- },
-
- enable: function () {
- $.Widget.prototype.enable.call(this);
- this._initEventHandlers();
+ // This method is exposed to the widget API and allows to query
+ // the number of active uploads:
+ active: function () {
+ return this._active;
},
- disable: function () {
- this._destroyEventHandlers();
- $.Widget.prototype.disable.call(this);
+ // This method is exposed to the widget API and allows to query
+ // the widget upload progress.
+ // It returns an object with loaded, total and bitrate properties
+ // for the running uploads:
+ progress: function () {
+ return this._progress;
},
// This method is exposed to the widget API and allows adding files
@@ -839,21 +1262,65 @@
// must have a files property and can contain additional options:
// .fileupload('add', {files: filesList});
add: function (data) {
+ var that = this;
if (!data || this.options.disabled) {
return;
}
- data.files = $.each($.makeArray(data.files), this._normalizeFile);
- this._onAdd(null, data);
+ if (data.fileInput && !data.files) {
+ this._getFileInputFiles(data.fileInput).always(function (files) {
+ data.files = files;
+ that._onAdd(null, data);
+ });
+ } else {
+ data.files = $.makeArray(data.files);
+ this._onAdd(null, data);
+ }
},
// This method is exposed to the widget API and allows sending files
// using the fileupload API. The data parameter accepts an object which
- // must have a files property and can contain additional options:
+ // must have a files or fileInput property and can contain additional options:
// .fileupload('send', {files: filesList});
// The method returns a Promise object for the file upload call.
send: function (data) {
if (data && !this.options.disabled) {
- data.files = $.each($.makeArray(data.files), this._normalizeFile);
+ if (data.fileInput && !data.files) {
+ var that = this,
+ dfd = $.Deferred(),
+ promise = dfd.promise(),
+ jqXHR,
+ aborted;
+ promise.abort = function () {
+ aborted = true;
+ if (jqXHR) {
+ return jqXHR.abort();
+ }
+ dfd.reject(null, 'abort', 'abort');
+ return promise;
+ };
+ this._getFileInputFiles(data.fileInput).always(
+ function (files) {
+ if (aborted) {
+ return;
+ }
+ if (!files.length) {
+ dfd.reject();
+ return;
+ }
+ data.files = files;
+ jqXHR = that._onSend(null, data).then(
+ function (result, textStatus, jqXHR) {
+ dfd.resolve(result, textStatus, jqXHR);
+ },
+ function (jqXHR, textStatus, errorThrown) {
+ dfd.reject(jqXHR, textStatus, errorThrown);
+ }
+ );
+ }
+ );
+ return this._enhancePromise(promise);
+ }
+ data.files = $.makeArray(data.files);
if (data.files.length) {
return this._onSend(null, data);
}
@@ -863,4 +1330,4 @@
});
-}));
+})); \ No newline at end of file
diff --git a/apps/files/js/jquery.iframe-transport.js b/apps/files/js/jquery.iframe-transport.js
index d85c0c11297..5c9df77976b 100644
--- a/apps/files/js/jquery.iframe-transport.js
+++ b/apps/files/js/jquery.iframe-transport.js
@@ -1,5 +1,5 @@
/*
- * jQuery Iframe Transport Plugin 1.3
+ * jQuery Iframe Transport Plugin 1.7
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
@@ -30,27 +30,45 @@
// The iframe transport accepts three additional options:
// options.fileInput: a jQuery collection of file input fields
// options.paramName: the parameter name for the file form data,
- // overrides the name property of the file input field(s)
+ // overrides the name property of the file input field(s),
+ // can be a string or an array of strings.
// options.formData: an array of objects with name and value properties,
// equivalent to the return data of .serializeArray(), e.g.:
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
$.ajaxTransport('iframe', function (options) {
- if (options.async && (options.type === 'POST' || options.type === 'GET')) {
+ if (options.async) {
var form,
- iframe;
+ iframe,
+ addParamChar;
return {
send: function (_, completeCallback) {
form = $('<form style="display:none;"></form>');
+ form.attr('accept-charset', options.formAcceptCharset);
+ addParamChar = /\?/.test(options.url) ? '&' : '?';
+ // XDomainRequest only supports GET and POST:
+ if (options.type === 'DELETE') {
+ options.url = options.url + addParamChar + '_method=DELETE';
+ options.type = 'POST';
+ } else if (options.type === 'PUT') {
+ options.url = options.url + addParamChar + '_method=PUT';
+ options.type = 'POST';
+ } else if (options.type === 'PATCH') {
+ options.url = options.url + addParamChar + '_method=PATCH';
+ options.type = 'POST';
+ }
// javascript:false as initial iframe src
// prevents warning popups on HTTPS in IE6.
// IE versions below IE8 cannot set the name property of
// elements that have already been added to the DOM,
// so we set the name along with the iframe HTML markup:
+ counter += 1;
iframe = $(
'<iframe src="javascript:false;" name="iframe-transport-' +
- (counter += 1) + '"></iframe>'
+ counter + '"></iframe>'
).bind('load', function () {
- var fileInputClones;
+ var fileInputClones,
+ paramNames = $.isArray(options.paramName) ?
+ options.paramName : [options.paramName];
iframe
.unbind('load')
.bind('load', function () {
@@ -79,7 +97,12 @@
// (happens on form submits to iframe targets):
$('<iframe src="javascript:false;"></iframe>')
.appendTo(form);
- form.remove();
+ window.setTimeout(function () {
+ // Removing the form in a setTimeout call
+ // allows Chrome's developer tools to display
+ // the response result
+ form.remove();
+ }, 0);
});
form
.prop('target', iframe.prop('name'))
@@ -101,8 +124,11 @@
return fileInputClones[index];
});
if (options.paramName) {
- options.fileInput.each(function () {
- $(this).prop('name', options.paramName);
+ options.fileInput.each(function (index) {
+ $(this).prop(
+ 'name',
+ paramNames[index] || options.paramName
+ );
});
}
// Appending the file input fields to the hidden form
@@ -144,22 +170,36 @@
});
// The iframe transport returns the iframe content document as response.
- // The following adds converters from iframe to text, json, html, and script:
+ // The following adds converters from iframe to text, json, html, xml
+ // and script.
+ // Please note that the Content-Type for JSON responses has to be text/plain
+ // or text/html, if the browser doesn't include application/json in the
+ // Accept header, else IE will show a download dialog.
+ // The Content-Type for XML responses on the other hand has to be always
+ // application/xml or text/xml, so IE properly parses the XML response.
+ // See also
+ // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
$.ajaxSetup({
converters: {
'iframe text': function (iframe) {
- return $(iframe[0].body).text();
+ return iframe && $(iframe[0].body).text();
},
'iframe json': function (iframe) {
- return $.parseJSON($(iframe[0].body).text());
+ return iframe && $.parseJSON($(iframe[0].body).text());
},
'iframe html': function (iframe) {
- return $(iframe[0].body).html();
+ return iframe && $(iframe[0].body).html();
+ },
+ 'iframe xml': function (iframe) {
+ var xmlDoc = iframe && iframe[0];
+ return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
+ $.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
+ $(xmlDoc.body).html());
},
'iframe script': function (iframe) {
- return $.globalEval($(iframe[0].body).text());
+ return iframe && $.globalEval($(iframe[0].body).text());
}
}
});
-}));
+})); \ No newline at end of file
diff --git a/apps/files/l10n/ach.php b/apps/files/l10n/ach.php
new file mode 100644
index 00000000000..3c711e6b78a
--- /dev/null
+++ b/apps/files/l10n/ach.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array("",""),
+"_%n file_::_%n files_" => array("",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n > 1);";
diff --git a/apps/files/l10n/af_ZA.php b/apps/files/l10n/af_ZA.php
new file mode 100644
index 00000000000..0157af093e9
--- /dev/null
+++ b/apps/files/l10n/af_ZA.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array("",""),
+"_%n file_::_%n files_" => array("",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files/l10n/ar.php b/apps/files/l10n/ar.php
index 99eb409a369..67a3414819b 100644
--- a/apps/files/l10n/ar.php
+++ b/apps/files/l10n/ar.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "المجلد المؤقت غير موجود",
"Failed to write to disk" => "خطأ في الكتابة على القرص الصلب",
"Not enough storage available" => "لا يوجد مساحة تخزينية كافية",
-"Upload failed" => "عملية الرفع فشلت",
"Invalid directory." => "مسار غير صحيح.",
"Files" => "الملفات",
-"Unable to upload your file as it is a directory or has 0 bytes" => "فشل في رفع ملفاتك , إما أنها مجلد أو حجمها 0 بايت",
"Not enough space available" => "لا توجد مساحة كافية",
"Upload cancelled." => "تم إلغاء عملية رفع الملفات .",
"File upload is in progress. Leaving the page now will cancel the upload." => "عملية رفع الملفات قيد التنفيذ. اغلاق الصفحة سوف يلغي عملية رفع الملفات.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("","","","","",""),
"{dirs} and {files}" => "{dirs} و {files}",
"_Uploading %n file_::_Uploading %n files_" => array("","","","","",""),
-"files uploading" => "يتم تحميل الملفات",
"'.' is an invalid file name." => "\".\" اسم ملف غير صحيح.",
"File name cannot be empty." => "اسم الملف لا يجوز أن يكون فارغا",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "اسم غير صحيح , الرموز '\\', '/', '<', '>', ':', '\"', '|', '?' و \"*\" غير مسموح استخدامها",
diff --git a/apps/files/l10n/be.php b/apps/files/l10n/be.php
new file mode 100644
index 00000000000..17262d2184d
--- /dev/null
+++ b/apps/files/l10n/be.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array("","","",""),
+"_%n file_::_%n files_" => array("","","",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","","","")
+);
+$PLURAL_FORMS = "nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/apps/files/l10n/bg_BG.php b/apps/files/l10n/bg_BG.php
index 913875e863a..e7dafd1c43a 100644
--- a/apps/files/l10n/bg_BG.php
+++ b/apps/files/l10n/bg_BG.php
@@ -6,7 +6,6 @@ $TRANSLATIONS = array(
"No file was uploaded" => "Фахлът не бе качен",
"Missing a temporary folder" => "Липсва временна папка",
"Failed to write to disk" => "Възникна проблем при запис в диска",
-"Upload failed" => "Качването е неуспешно",
"Invalid directory." => "Невалидна директория.",
"Files" => "Файлове",
"Upload cancelled." => "Качването е спряно.",
diff --git a/apps/files/l10n/bn_BD.php b/apps/files/l10n/bn_BD.php
index 2265c232a14..66ac3a2165f 100644
--- a/apps/files/l10n/bn_BD.php
+++ b/apps/files/l10n/bn_BD.php
@@ -12,7 +12,6 @@ $TRANSLATIONS = array(
"Failed to write to disk" => "ডিস্কে লিখতে ব্যর্থ",
"Invalid directory." => "ভুল ডিরেক্টরি",
"Files" => "ফাইল",
-"Unable to upload your file as it is a directory or has 0 bytes" => "আপনার ফাইলটি আপলোড করা সম্ভব হলো না, কেননা এটি হয় একটি ফোল্ডার কিংবা এর আকার ০ বাইট",
"Not enough space available" => "যথেষ্ঠ পরিমাণ স্থান নেই",
"Upload cancelled." => "আপলোড বাতিল করা হয়েছে।",
"File upload is in progress. Leaving the page now will cancel the upload." => "ফাইল আপলোড চলমান। এই পৃষ্ঠা পরিত্যাগ করলে আপলোড বাতিল করা হবে।",
diff --git a/apps/files/l10n/bs.php b/apps/files/l10n/bs.php
new file mode 100644
index 00000000000..8ab07a97761
--- /dev/null
+++ b/apps/files/l10n/bs.php
@@ -0,0 +1,12 @@
+<?php
+$TRANSLATIONS = array(
+"Share" => "Podijeli",
+"_%n folder_::_%n folders_" => array("","",""),
+"_%n file_::_%n files_" => array("","",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","",""),
+"Name" => "Ime",
+"Size" => "Veličina",
+"Save" => "Spasi",
+"Folder" => "Fasikla"
+);
+$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/apps/files/l10n/ca.php b/apps/files/l10n/ca.php
index eb724d19548..8fd72ac0a68 100644
--- a/apps/files/l10n/ca.php
+++ b/apps/files/l10n/ca.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Falta un fitxer temporal",
"Failed to write to disk" => "Ha fallat en escriure al disc",
"Not enough storage available" => "No hi ha prou espai disponible",
-"Upload failed" => "La pujada ha fallat",
"Invalid directory." => "Directori no vàlid.",
"Files" => "Fitxers",
-"Unable to upload your file as it is a directory or has 0 bytes" => "No es pot pujar el fitxer perquè és una carpeta o té 0 bytes",
"Not enough space available" => "No hi ha prou espai disponible",
"Upload cancelled." => "La pujada s'ha cancel·lat.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Hi ha una pujada en curs. Si abandoneu la pàgina la pujada es cancel·larà.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n fitxer","%n fitxers"),
"{dirs} and {files}" => "{dirs} i {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Pujant %n fitxer","Pujant %n fitxers"),
-"files uploading" => "fitxers pujant",
"'.' is an invalid file name." => "'.' és un nom no vàlid per un fitxer.",
"File name cannot be empty." => "El nom del fitxer no pot ser buit.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "El nóm no és vàlid, '\\', '/', '<', '>', ':', '\"', '|', '?' i '*' no estan permesos.",
diff --git a/apps/files/l10n/cs_CZ.php b/apps/files/l10n/cs_CZ.php
index 691cc92f1ad..f67283ec6e8 100644
--- a/apps/files/l10n/cs_CZ.php
+++ b/apps/files/l10n/cs_CZ.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Chybí adresář pro dočasné soubory",
"Failed to write to disk" => "Zápis na disk selhal",
"Not enough storage available" => "Nedostatek dostupného úložného prostoru",
-"Upload failed" => "Odesílání selhalo",
"Invalid directory." => "Neplatný adresář",
"Files" => "Soubory",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Nelze odeslat Váš soubor, protože je to adresář nebo jeho velikost je 0 bajtů",
"Not enough space available" => "Nedostatek volného místa",
"Upload cancelled." => "Odesílání zrušeno.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Probíhá odesílání souboru. Opuštění stránky způsobí zrušení nahrávání.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n soubor","%n soubory","%n souborů"),
"{dirs} and {files}" => "{dirs} a {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Nahrávám %n soubor","Nahrávám %n soubory","Nahrávám %n souborů"),
-"files uploading" => "soubory se odesílají",
"'.' is an invalid file name." => "'.' je neplatným názvem souboru.",
"File name cannot be empty." => "Název souboru nemůže být prázdný řetězec.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neplatný název, znaky '\\', '/', '<', '>', ':', '\"', '|', '?' a '*' nejsou povoleny.",
diff --git a/apps/files/l10n/cy_GB.php b/apps/files/l10n/cy_GB.php
index 157f4f89a23..86e5f65e7b0 100644
--- a/apps/files/l10n/cy_GB.php
+++ b/apps/files/l10n/cy_GB.php
@@ -11,10 +11,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Plygell dros dro yn eisiau",
"Failed to write to disk" => "Methwyd ysgrifennu i'r ddisg",
"Not enough storage available" => "Dim digon o le storio ar gael",
-"Upload failed" => "Methwyd llwytho i fyny",
"Invalid directory." => "Cyfeiriadur annilys.",
"Files" => "Ffeiliau",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Methu llwytho'ch ffeil i fyny gan ei fod yn gyferiadur neu'n cynnwys 0 beit",
"Not enough space available" => "Dim digon o le ar gael",
"Upload cancelled." => "Diddymwyd llwytho i fyny.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Mae ffeiliau'n cael eu llwytho i fyny. Bydd gadael y dudalen hon nawr yn diddymu'r broses.",
@@ -33,7 +31,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("","","",""),
"_%n file_::_%n files_" => array("","","",""),
"_Uploading %n file_::_Uploading %n files_" => array("","","",""),
-"files uploading" => "ffeiliau'n llwytho i fyny",
"'.' is an invalid file name." => "Mae '.' yn enw ffeil annilys.",
"File name cannot be empty." => "Does dim hawl cael enw ffeil gwag.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Enw annilys, ni chaniateir, '\\', '/', '<', '>', ':', '\"', '|', '?' na '*'.",
diff --git a/apps/files/l10n/da.php b/apps/files/l10n/da.php
index aab12986ec1..c2a20931ba0 100644
--- a/apps/files/l10n/da.php
+++ b/apps/files/l10n/da.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Manglende midlertidig mappe.",
"Failed to write to disk" => "Fejl ved skrivning til disk.",
"Not enough storage available" => "Der er ikke nok plads til rådlighed",
-"Upload failed" => "Upload fejlede",
"Invalid directory." => "Ugyldig mappe.",
"Files" => "Filer",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Kan ikke uploade din fil - det er enten en mappe eller en fil med et indhold på 0 bytes.",
"Not enough space available" => "ikke nok tilgængelig ledig plads ",
"Upload cancelled." => "Upload afbrudt.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Fil upload kører. Hvis du forlader siden nu, vil uploadet blive annuleret.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n fil","%n filer"),
"{dirs} and {files}" => "{dirs} og {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Uploader %n fil","Uploader %n filer"),
-"files uploading" => "uploader filer",
"'.' is an invalid file name." => "'.' er et ugyldigt filnavn.",
"File name cannot be empty." => "Filnavnet kan ikke stå tomt.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ugyldigt navn, '\\', '/', '<', '>', ':' | '?', '\"', '', og '*' er ikke tilladt.",
diff --git a/apps/files/l10n/de.php b/apps/files/l10n/de.php
index 947d4f07461..143a5efc3da 100644
--- a/apps/files/l10n/de.php
+++ b/apps/files/l10n/de.php
@@ -13,12 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Kein temporärer Ordner vorhanden",
"Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte",
"Not enough storage available" => "Nicht genug Speicher vorhanden.",
-"Upload failed" => "Hochladen fehlgeschlagen",
+"Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Dateiinformationen konnten nicht abgerufen werden.",
+"Upload failed. Could not find uploaded file" => "Hochladen fehlgeschlagen. Hochgeladene Datei konnte nicht gefunden werden.",
"Invalid directory." => "Ungültiges Verzeichnis.",
"Files" => "Dateien",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Deine Datei kann nicht hochgeladen werden, weil es sich um einen Ordner handelt oder 0 Bytes groß ist.",
+"Unable to upload {filename} as it is a directory or has 0 bytes" => "Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist",
"Not enough space available" => "Nicht genug Speicherplatz verfügbar",
"Upload cancelled." => "Upload abgebrochen.",
+"Could not get result from server." => "Ergebnis konnte nicht vom Server abgerufen werden.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Dateiupload läuft. Wenn Du die Seite jetzt verlässt, wird der Upload abgebrochen.",
"URL cannot be empty." => "Die URL darf nicht leer sein.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Der Ordnername ist ungültig. Nur ownCloud kann den Ordner \"Shared\" anlegen",
@@ -37,7 +39,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n Datei","%n Dateien"),
"{dirs} and {files}" => "{dirs} und {files}",
"_Uploading %n file_::_Uploading %n files_" => array("%n Datei wird hochgeladen","%n Dateien werden hochgeladen"),
-"files uploading" => "Dateien werden hoch geladen",
"'.' is an invalid file name." => "'.' ist kein gültiger Dateiname.",
"File name cannot be empty." => "Der Dateiname darf nicht leer sein.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.",
@@ -45,6 +46,7 @@ $TRANSLATIONS = array(
"Your storage is almost full ({usedSpacePercent}%)" => "Dein Speicher ist fast voll ({usedSpacePercent}%)",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Die Verschlüsselung wurde deaktiviert, jedoch sind deine Dateien nach wie vor verschlüsselt. Bitte gehe zu deinen persönlichen Einstellungen, um deine Dateien zu entschlüsseln.",
"Your download is being prepared. This might take some time if the files are big." => "Dein Download wird vorbereitet. Dies kann bei größeren Dateien etwas dauern.",
+"Error moving file" => "Fehler beim Verschieben der Datei",
"Name" => "Name",
"Size" => "Größe",
"Modified" => "Geändert",
diff --git a/apps/files/l10n/de_AT.php b/apps/files/l10n/de_AT.php
new file mode 100644
index 00000000000..0157af093e9
--- /dev/null
+++ b/apps/files/l10n/de_AT.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array("",""),
+"_%n file_::_%n files_" => array("",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files/l10n/de_CH.php b/apps/files/l10n/de_CH.php
new file mode 100644
index 00000000000..a7074a8b1cc
--- /dev/null
+++ b/apps/files/l10n/de_CH.php
@@ -0,0 +1,74 @@
+<?php
+$TRANSLATIONS = array(
+"Could not move %s - File with this name already exists" => "%s konnte nicht verschoben werden. Eine Datei mit diesem Namen existiert bereits.",
+"Could not move %s" => "Konnte %s nicht verschieben",
+"Unable to set upload directory." => "Das Upload-Verzeichnis konnte nicht gesetzt werden.",
+"Invalid Token" => "Ungültiges Merkmal",
+"No file was uploaded. Unknown error" => "Keine Datei hochgeladen. Unbekannter Fehler",
+"There is no error, the file uploaded with success" => "Es ist kein Fehler aufgetreten. Die Datei wurde erfolgreich hochgeladen.",
+"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Die hochgeladene Datei überschreitet die upload_max_filesize Vorgabe in php.ini",
+"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Die Datei ist grösser, als die MAX_FILE_SIZE Vorgabe erlaubt, die im HTML-Formular spezifiziert ist",
+"The uploaded file was only partially uploaded" => "Die Datei konnte nur teilweise übertragen werden",
+"No file was uploaded" => "Keine Datei konnte übertragen werden.",
+"Missing a temporary folder" => "Kein temporärer Ordner vorhanden",
+"Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte",
+"Not enough storage available" => "Nicht genug Speicher vorhanden.",
+"Invalid directory." => "Ungültiges Verzeichnis.",
+"Files" => "Dateien",
+"Not enough space available" => "Nicht genügend Speicherplatz verfügbar",
+"Upload cancelled." => "Upload abgebrochen.",
+"File upload is in progress. Leaving the page now will cancel the upload." => "Dateiupload läuft. Wenn Sie die Seite jetzt verlassen, wird der Upload abgebrochen.",
+"URL cannot be empty." => "Die URL darf nicht leer sein.",
+"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Ungültiger Ordnername. Die Verwendung von «Shared» ist ownCloud vorbehalten.",
+"Error" => "Fehler",
+"Share" => "Teilen",
+"Delete permanently" => "Endgültig löschen",
+"Rename" => "Umbenennen",
+"Pending" => "Ausstehend",
+"{new_name} already exists" => "{new_name} existiert bereits",
+"replace" => "ersetzen",
+"suggest name" => "Namen vorschlagen",
+"cancel" => "abbrechen",
+"replaced {new_name} with {old_name}" => "{old_name} wurde ersetzt durch {new_name}",
+"undo" => "rückgängig machen",
+"_%n folder_::_%n folders_" => array("","%n Ordner"),
+"_%n file_::_%n files_" => array("","%n Dateien"),
+"_Uploading %n file_::_Uploading %n files_" => array("%n Datei wird hochgeladen","%n Dateien werden hochgeladen"),
+"'.' is an invalid file name." => "'.' ist kein gültiger Dateiname.",
+"File name cannot be empty." => "Der Dateiname darf nicht leer sein.",
+"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, «\\», «/», «<», «>», «:», «\"», «|», «?» und «*» sind nicht zulässig.",
+"Your storage is full, files can not be updated or synced anymore!" => "Ihr Speicher ist voll, daher können keine Dateien mehr aktualisiert oder synchronisiert werden!",
+"Your storage is almost full ({usedSpacePercent}%)" => "Ihr Speicher ist fast voll ({usedSpacePercent}%)",
+"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Die Verschlüsselung wurde deaktiviert, jedoch sind Ihre Dateien nach wie vor verschlüsselt. Bitte gehen Sie zu Ihren persönlichen Einstellungen, um Ihre Dateien zu entschlüsseln.",
+"Your download is being prepared. This might take some time if the files are big." => "Ihr Download wird vorbereitet. Dies kann bei grösseren Dateien etwas dauern.",
+"Name" => "Name",
+"Size" => "Grösse",
+"Modified" => "Geändert",
+"%s could not be renamed" => "%s konnte nicht umbenannt werden",
+"Upload" => "Hochladen",
+"File handling" => "Dateibehandlung",
+"Maximum upload size" => "Maximale Upload-Grösse",
+"max. possible: " => "maximal möglich:",
+"Needed for multi-file and folder downloads." => "Für Mehrfachdatei- und Ordnerdownloads benötigt:",
+"Enable ZIP-download" => "ZIP-Download aktivieren",
+"0 is unlimited" => "0 bedeutet unbegrenzt",
+"Maximum input size for ZIP files" => "Maximale Grösse für ZIP-Dateien",
+"Save" => "Speichern",
+"New" => "Neu",
+"Text file" => "Textdatei",
+"Folder" => "Ordner",
+"From link" => "Von einem Link",
+"Deleted files" => "Gelöschte Dateien",
+"Cancel upload" => "Upload abbrechen",
+"You don’t have write permissions here." => "Sie haben hier keine Schreib-Berechtigungen.",
+"Nothing in here. Upload something!" => "Alles leer. Laden Sie etwas hoch!",
+"Download" => "Herunterladen",
+"Unshare" => "Freigabe aufheben",
+"Delete" => "Löschen",
+"Upload too large" => "Der Upload ist zu gross",
+"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Die Datei überschreitet die Maximalgrösse für Uploads auf diesem Server.",
+"Files are being scanned, please wait." => "Dateien werden gescannt, bitte warten.",
+"Current scanning" => "Scanne",
+"Upgrading filesystem cache..." => "Dateisystem-Cache wird aktualisiert ..."
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files/l10n/de_DE.php b/apps/files/l10n/de_DE.php
index db07ed7fadd..c58cb4bbe3e 100644
--- a/apps/files/l10n/de_DE.php
+++ b/apps/files/l10n/de_DE.php
@@ -13,12 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Kein temporärer Ordner vorhanden",
"Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte",
"Not enough storage available" => "Nicht genug Speicher vorhanden.",
-"Upload failed" => "Hochladen fehlgeschlagen",
+"Upload failed. Could not get file info." => "Hochladen fehlgeschlagen. Dateiinformationen konnten nicht abgerufen werden.",
+"Upload failed. Could not find uploaded file" => "Hochladen fehlgeschlagen. Hochgeladene Datei konnte nicht gefunden werden.",
"Invalid directory." => "Ungültiges Verzeichnis.",
"Files" => "Dateien",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Ihre Datei kann nicht hochgeladen werden, weil es sich um einen Ordner handelt oder 0 Bytes groß ist.",
+"Unable to upload {filename} as it is a directory or has 0 bytes" => "Datei {filename} kann nicht hochgeladen werden, da sie entweder ein Verzeichnis oder 0 Bytes groß ist",
"Not enough space available" => "Nicht genügend Speicherplatz verfügbar",
"Upload cancelled." => "Upload abgebrochen.",
+"Could not get result from server." => "Ergebnis konnte nicht vom Server abgerufen werden.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Dateiupload läuft. Wenn Sie die Seite jetzt verlassen, wird der Upload abgebrochen.",
"URL cannot be empty." => "Die URL darf nicht leer sein.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Ungültiger Ordnername. Die Verwendung von \"Shared\" ist ownCloud vorbehalten.",
@@ -37,7 +39,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n Datei","%n Dateien"),
"{dirs} and {files}" => "{dirs} und {files}",
"_Uploading %n file_::_Uploading %n files_" => array("%n Datei wird hoch geladen","%n Dateien werden hoch geladen"),
-"files uploading" => "Dateien werden hoch geladen",
"'.' is an invalid file name." => "'.' ist kein gültiger Dateiname.",
"File name cannot be empty." => "Der Dateiname darf nicht leer sein.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.",
@@ -45,6 +46,7 @@ $TRANSLATIONS = array(
"Your storage is almost full ({usedSpacePercent}%)" => "Ihr Speicher ist fast voll ({usedSpacePercent}%)",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Die Verschlüsselung wurde deaktiviert, jedoch sind Ihre Dateien nach wie vor verschlüsselt. Bitte gehen Sie zu Ihren persönlichen Einstellungen, um Ihre Dateien zu entschlüsseln.",
"Your download is being prepared. This might take some time if the files are big." => "Ihr Download wird vorbereitet. Dies kann bei größeren Dateien etwas dauern.",
+"Error moving file" => "Fehler beim Verschieben der Datei",
"Name" => "Name",
"Size" => "Größe",
"Modified" => "Geändert",
diff --git a/apps/files/l10n/el.php b/apps/files/l10n/el.php
index 8c89e5e1feb..37a61c6b956 100644
--- a/apps/files/l10n/el.php
+++ b/apps/files/l10n/el.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Λείπει ο προσωρινός φάκελος",
"Failed to write to disk" => "Αποτυχία εγγραφής στο δίσκο",
"Not enough storage available" => "Μη επαρκής διαθέσιμος αποθηκευτικός χώρος",
-"Upload failed" => "Η μεταφόρτωση απέτυχε",
"Invalid directory." => "Μη έγκυρος φάκελος.",
"Files" => "Αρχεία",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Αδυναμία στην αποστολή του αρχείου σας αφού είναι φάκελος ή έχει 0 bytes",
"Not enough space available" => "Δεν υπάρχει αρκετός διαθέσιμος χώρος",
"Upload cancelled." => "Η αποστολή ακυρώθηκε.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Η αποστολή του αρχείου βρίσκεται σε εξέλιξη. Το κλείσιμο της σελίδας θα ακυρώσει την αποστολή.",
@@ -36,7 +34,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("%n φάκελος","%n φάκελοι"),
"_%n file_::_%n files_" => array("%n αρχείο","%n αρχεία"),
"_Uploading %n file_::_Uploading %n files_" => array("Ανέβασμα %n αρχείου","Ανέβασμα %n αρχείων"),
-"files uploading" => "αρχεία ανεβαίνουν",
"'.' is an invalid file name." => "'.' είναι μη έγκυρο όνομα αρχείου.",
"File name cannot be empty." => "Το όνομα αρχείου δεν μπορεί να είναι κενό.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Μη έγκυρο όνομα, '\\', '/', '<', '>', ':', '\"', '|', '?' και '*' δεν επιτρέπονται.",
diff --git a/apps/files/l10n/en_GB.php b/apps/files/l10n/en_GB.php
new file mode 100644
index 00000000000..e67719efba9
--- /dev/null
+++ b/apps/files/l10n/en_GB.php
@@ -0,0 +1,75 @@
+<?php
+$TRANSLATIONS = array(
+"Could not move %s - File with this name already exists" => "Could not move %s - File with this name already exists",
+"Could not move %s" => "Could not move %s",
+"Unable to set upload directory." => "Unable to set upload directory.",
+"Invalid Token" => "Invalid Token",
+"No file was uploaded. Unknown error" => "No file was uploaded. Unknown error",
+"There is no error, the file uploaded with success" => "There is no error, the file uploaded successfully",
+"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "The uploaded file exceeds the upload_max_filesize directive in php.ini: ",
+"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form",
+"The uploaded file was only partially uploaded" => "The uploaded file was only partially uploaded",
+"No file was uploaded" => "No file was uploaded",
+"Missing a temporary folder" => "Missing a temporary folder",
+"Failed to write to disk" => "Failed to write to disk",
+"Not enough storage available" => "Not enough storage available",
+"Invalid directory." => "Invalid directory.",
+"Files" => "Files",
+"Not enough space available" => "Not enough space available",
+"Upload cancelled." => "Upload cancelled.",
+"File upload is in progress. Leaving the page now will cancel the upload." => "File upload is in progress. Leaving the page now will cancel the upload.",
+"URL cannot be empty." => "URL cannot be empty.",
+"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Invalid folder name. Usage of 'Shared' is reserved by ownCloud",
+"Error" => "Error",
+"Share" => "Share",
+"Delete permanently" => "Delete permanently",
+"Rename" => "Rename",
+"Pending" => "Pending",
+"{new_name} already exists" => "{new_name} already exists",
+"replace" => "replace",
+"suggest name" => "suggest name",
+"cancel" => "cancel",
+"replaced {new_name} with {old_name}" => "replaced {new_name} with {old_name}",
+"undo" => "undo",
+"_%n folder_::_%n folders_" => array("%n folder","%n folders"),
+"_%n file_::_%n files_" => array("%n file","%n files"),
+"{dirs} and {files}" => "{dirs} and {files}",
+"_Uploading %n file_::_Uploading %n files_" => array("Uploading %n file","Uploading %n files"),
+"'.' is an invalid file name." => "'.' is an invalid file name.",
+"File name cannot be empty." => "File name cannot be empty.",
+"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed.",
+"Your storage is full, files can not be updated or synced anymore!" => "Your storage is full, files can not be updated or synced anymore!",
+"Your storage is almost full ({usedSpacePercent}%)" => "Your storage is almost full ({usedSpacePercent}%)",
+"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.",
+"Your download is being prepared. This might take some time if the files are big." => "Your download is being prepared. This might take some time if the files are big.",
+"Name" => "Name",
+"Size" => "Size",
+"Modified" => "Modified",
+"%s could not be renamed" => "%s could not be renamed",
+"Upload" => "Upload",
+"File handling" => "File handling",
+"Maximum upload size" => "Maximum upload size",
+"max. possible: " => "max. possible: ",
+"Needed for multi-file and folder downloads." => "Needed for multi-file and folder downloads.",
+"Enable ZIP-download" => "Enable ZIP-download",
+"0 is unlimited" => "0 is unlimited",
+"Maximum input size for ZIP files" => "Maximum input size for ZIP files",
+"Save" => "Save",
+"New" => "New",
+"Text file" => "Text file",
+"Folder" => "Folder",
+"From link" => "From link",
+"Deleted files" => "Deleted files",
+"Cancel upload" => "Cancel upload",
+"You don’t have write permissions here." => "You don’t have write permission here.",
+"Nothing in here. Upload something!" => "Nothing in here. Upload something!",
+"Download" => "Download",
+"Unshare" => "Unshare",
+"Delete" => "Delete",
+"Upload too large" => "Upload too large",
+"The files you are trying to upload exceed the maximum size for file uploads on this server." => "The files you are trying to upload exceed the maximum size for file uploads on this server.",
+"Files are being scanned, please wait." => "Files are being scanned, please wait.",
+"Current scanning" => "Current scanning",
+"Upgrading filesystem cache..." => "Upgrading filesystem cache..."
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files/l10n/eo.php b/apps/files/l10n/eo.php
index ad538f2f2a9..eb6e6ba2d39 100644
--- a/apps/files/l10n/eo.php
+++ b/apps/files/l10n/eo.php
@@ -11,10 +11,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Mankas provizora dosierujo.",
"Failed to write to disk" => "Malsukcesis skribo al disko",
"Not enough storage available" => "Ne haveblas sufiĉa memoro",
-"Upload failed" => "Alŝuto malsukcesis",
"Invalid directory." => "Nevalida dosierujo.",
"Files" => "Dosieroj",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Ne eblis alŝuti vian dosieron ĉar ĝi estas dosierujo aŭ havas 0 duumokojn",
"Not enough space available" => "Ne haveblas sufiĉa spaco",
"Upload cancelled." => "La alŝuto nuliĝis.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Dosieralŝuto plenumiĝas. Lasi la paĝon nun nuligus la alŝuton.",
@@ -34,7 +32,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("",""),
-"files uploading" => "dosieroj estas alŝutataj",
"'.' is an invalid file name." => "'.' ne estas valida dosiernomo.",
"File name cannot be empty." => "Dosiernomo devas ne malpleni.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nevalida nomo: “\\”, “/”, “<”, “>”, “:”, “\"”, “|”, “?” kaj “*” ne permesatas.",
diff --git a/apps/files/l10n/es.php b/apps/files/l10n/es.php
index ce92ff8f187..90d760587d9 100644
--- a/apps/files/l10n/es.php
+++ b/apps/files/l10n/es.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Falta la carpeta temporal",
"Failed to write to disk" => "Falló al escribir al disco",
"Not enough storage available" => "No hay suficiente espacio disponible",
-"Upload failed" => "Error en la subida",
"Invalid directory." => "Directorio inválido.",
"Files" => "Archivos",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Incapaz de subir su archivo, es un directorio o tiene 0 bytes",
"Not enough space available" => "No hay suficiente espacio disponible",
"Upload cancelled." => "Subida cancelada.",
"File upload is in progress. Leaving the page now will cancel the upload." => "La subida del archivo está en proceso. Si sale de la página ahora cancelará la subida.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("","%n archivos"),
"{dirs} and {files}" => "{dirs} y {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Subiendo %n archivo","Subiendo %n archivos"),
-"files uploading" => "subiendo archivos",
"'.' is an invalid file name." => "'.' no es un nombre de archivo válido.",
"File name cannot be empty." => "El nombre de archivo no puede estar vacío.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nombre Invalido, \"\\\", \"/\", \"<\", \">\", \":\", \"\", \"|\" \"?\" y \"*\" no están permitidos ",
diff --git a/apps/files/l10n/es_AR.php b/apps/files/l10n/es_AR.php
index d9d10362630..be16f3f99ae 100644
--- a/apps/files/l10n/es_AR.php
+++ b/apps/files/l10n/es_AR.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Falta un directorio temporal",
"Failed to write to disk" => "Error al escribir en el disco",
"Not enough storage available" => "No hay suficiente almacenamiento",
-"Upload failed" => "Error al subir el archivo",
"Invalid directory." => "Directorio inválido.",
"Files" => "Archivos",
-"Unable to upload your file as it is a directory or has 0 bytes" => "No fue posible subir el archivo porque es un directorio o porque su tamaño es 0 bytes",
"Not enough space available" => "No hay suficiente espacio disponible",
"Upload cancelled." => "La subida fue cancelada",
"File upload is in progress. Leaving the page now will cancel the upload." => "La subida del archivo está en proceso. Si salís de la página ahora, la subida se cancelará.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n archivo","%n archivos"),
"{dirs} and {files}" => "{carpetas} y {archivos}",
"_Uploading %n file_::_Uploading %n files_" => array("Subiendo %n archivo","Subiendo %n archivos"),
-"files uploading" => "Subiendo archivos",
"'.' is an invalid file name." => "'.' es un nombre de archivo inválido.",
"File name cannot be empty." => "El nombre del archivo no puede quedar vacío.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nombre invalido, '\\', '/', '<', '>', ':', '\"', '|', '?' y '*' no están permitidos.",
diff --git a/apps/files/l10n/es_MX.php b/apps/files/l10n/es_MX.php
new file mode 100644
index 00000000000..0157af093e9
--- /dev/null
+++ b/apps/files/l10n/es_MX.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array("",""),
+"_%n file_::_%n files_" => array("",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files/l10n/et_EE.php b/apps/files/l10n/et_EE.php
index 52ba1191706..9f674b27e63 100644
--- a/apps/files/l10n/et_EE.php
+++ b/apps/files/l10n/et_EE.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Ajutiste failide kaust puudub",
"Failed to write to disk" => "Kettale kirjutamine ebaõnnestus",
"Not enough storage available" => "Saadaval pole piisavalt ruumi",
-"Upload failed" => "Üleslaadimine ebaõnnestus",
"Invalid directory." => "Vigane kaust.",
"Files" => "Failid",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Faili ei saa üles laadida, kuna see on kaust või selle suurus on 0 baiti",
"Not enough space available" => "Pole piisavalt ruumi",
"Upload cancelled." => "Üleslaadimine tühistati.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Faili üleslaadimine on töös. Lehelt lahkumine katkestab selle üleslaadimise.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n fail","%n faili"),
"{dirs} and {files}" => "{dirs} ja {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Laadin üles %n faili","Laadin üles %n faili"),
-"files uploading" => "faili üleslaadimisel",
"'.' is an invalid file name." => "'.' on vigane failinimi.",
"File name cannot be empty." => "Faili nimi ei saa olla tühi.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Vigane nimi, '\\', '/', '<', '>', ':', '\"', '|', '?' ja '*' pole lubatud.",
diff --git a/apps/files/l10n/eu.php b/apps/files/l10n/eu.php
index 524be56af02..33ea47d5f04 100644
--- a/apps/files/l10n/eu.php
+++ b/apps/files/l10n/eu.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Aldi bateko karpeta falta da",
"Failed to write to disk" => "Errore bat izan da diskoan idazterakoan",
"Not enough storage available" => "Ez dago behar aina leku erabilgarri,",
-"Upload failed" => "igotzeak huts egin du",
"Invalid directory." => "Baliogabeko karpeta.",
"Files" => "Fitxategiak",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Ezin izan da zure fitxategia igo karpeta bat delako edo 0 byte dituelako",
"Not enough space available" => "Ez dago leku nahikorik.",
"Upload cancelled." => "Igoera ezeztatuta",
"File upload is in progress. Leaving the page now will cancel the upload." => "Fitxategien igoera martxan da. Orria orain uzteak igoera ezeztatutko du.",
@@ -36,7 +34,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("karpeta %n","%n karpeta"),
"_%n file_::_%n files_" => array("fitxategi %n","%n fitxategi"),
"_Uploading %n file_::_Uploading %n files_" => array("Fitxategi %n igotzen","%n fitxategi igotzen"),
-"files uploading" => "fitxategiak igotzen",
"'.' is an invalid file name." => "'.' ez da fitxategi izen baliogarria.",
"File name cannot be empty." => "Fitxategi izena ezin da hutsa izan.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "IZen aliogabea, '\\', '/', '<', '>', ':', '\"', '|', '?' eta '*' ez daude baimenduta.",
diff --git a/apps/files/l10n/fa.php b/apps/files/l10n/fa.php
index 24584f715b5..46d7cfe73ef 100644
--- a/apps/files/l10n/fa.php
+++ b/apps/files/l10n/fa.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "یک پوشه موقت گم شده",
"Failed to write to disk" => "نوشتن بر روی دیسک سخت ناموفق بود",
"Not enough storage available" => "فضای کافی در دسترس نیست",
-"Upload failed" => "بارگزاری ناموفق بود",
"Invalid directory." => "فهرست راهنما نامعتبر می باشد.",
"Files" => "پرونده‌ها",
-"Unable to upload your file as it is a directory or has 0 bytes" => "ناتوان در بارگذاری یا فایل یک پوشه است یا 0بایت دارد",
"Not enough space available" => "فضای کافی در دسترس نیست",
"Upload cancelled." => "بار گذاری لغو شد",
"File upload is in progress. Leaving the page now will cancel the upload." => "آپلودکردن پرونده در حال پیشرفت است. در صورت خروج از صفحه آپلود لغو میگردد. ",
@@ -36,7 +34,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array(""),
"_%n file_::_%n files_" => array(""),
"_Uploading %n file_::_Uploading %n files_" => array(""),
-"files uploading" => "بارگذاری فایل ها",
"'.' is an invalid file name." => "'.' یک نام پرونده نامعتبر است.",
"File name cannot be empty." => "نام پرونده نمی تواند خالی باشد.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "نام نامعتبر ، '\\', '/', '<', '>', ':', '\"', '|', '?' و '*' مجاز نمی باشند.",
diff --git a/apps/files/l10n/fi_FI.php b/apps/files/l10n/fi_FI.php
index 1d29dbf79d2..5345bad902b 100644
--- a/apps/files/l10n/fi_FI.php
+++ b/apps/files/l10n/fi_FI.php
@@ -11,12 +11,12 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Tilapäiskansio puuttuu",
"Failed to write to disk" => "Levylle kirjoitus epäonnistui",
"Not enough storage available" => "Tallennustilaa ei ole riittävästi käytettävissä",
-"Upload failed" => "Lähetys epäonnistui",
"Invalid directory." => "Virheellinen kansio.",
"Files" => "Tiedostot",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Tiedoston lähetys epäonnistui, koska sen koko on 0 tavua tai kyseessä on kansio.",
+"Unable to upload {filename} as it is a directory or has 0 bytes" => "Kohdetta {filename} ei voi lähettää, koska se on joko kansio tai sen koko on 0 tavua",
"Not enough space available" => "Tilaa ei ole riittävästi",
"Upload cancelled." => "Lähetys peruttu.",
+"Could not get result from server." => "Tuloksien saaminen palvelimelta ei onnistunut.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Tiedoston lähetys on meneillään. Sivulta poistuminen nyt peruu tiedoston lähetyksen.",
"URL cannot be empty." => "Verkko-osoite ei voi olla tyhjä",
"Error" => "Virhe",
@@ -39,6 +39,7 @@ $TRANSLATIONS = array(
"Your storage is full, files can not be updated or synced anymore!" => "Tallennustila on loppu, tiedostoja ei voi enää päivittää tai synkronoida!",
"Your storage is almost full ({usedSpacePercent}%)" => "Tallennustila on melkein loppu ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Lataustasi valmistellaan. Tämä saattaa kestää hetken, jos tiedostot ovat suuria kooltaan.",
+"Error moving file" => "Virhe tiedostoa siirrettäessä",
"Name" => "Nimi",
"Size" => "Koko",
"Modified" => "Muokattu",
diff --git a/apps/files/l10n/fr.php b/apps/files/l10n/fr.php
index 2d538262a0a..d6470458083 100644
--- a/apps/files/l10n/fr.php
+++ b/apps/files/l10n/fr.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Absence de dossier temporaire.",
"Failed to write to disk" => "Erreur d'écriture sur le disque",
"Not enough storage available" => "Plus assez d'espace de stockage disponible",
-"Upload failed" => "Échec de l'envoi",
"Invalid directory." => "Dossier invalide.",
"Files" => "Fichiers",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Impossible d'envoyer votre fichier dans la mesure où il s'agit d'un répertoire ou d'un fichier de taille nulle",
"Not enough space available" => "Espace disponible insuffisant",
"Upload cancelled." => "Envoi annulé.",
"File upload is in progress. Leaving the page now will cancel the upload." => "L'envoi du fichier est en cours. Quitter cette page maintenant annulera l'envoi du fichier.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n fichier","%n fichiers"),
"{dirs} and {files}" => "{dir} et {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Téléversement de %n fichier","Téléversement de %n fichiers"),
-"files uploading" => "fichiers en cours d'envoi",
"'.' is an invalid file name." => "'.' n'est pas un nom de fichier valide.",
"File name cannot be empty." => "Le nom de fichier ne peut être vide.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nom invalide, les caractères '\\', '/', '<', '>', ':', '\"', '|', '?' et '*' ne sont pas autorisés.",
diff --git a/apps/files/l10n/gl.php b/apps/files/l10n/gl.php
index 01a6b54f842..0eba94f7d60 100644
--- a/apps/files/l10n/gl.php
+++ b/apps/files/l10n/gl.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Falta o cartafol temporal",
"Failed to write to disk" => "Produciuse un erro ao escribir no disco",
"Not enough storage available" => "Non hai espazo de almacenamento abondo",
-"Upload failed" => "Produciuse un fallou no envío",
"Invalid directory." => "O directorio é incorrecto.",
"Files" => "Ficheiros",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Non foi posíbel enviar o ficheiro pois ou é un directorio ou ten 0 bytes",
"Not enough space available" => "O espazo dispoñíbel é insuficiente",
"Upload cancelled." => "Envío cancelado.",
"File upload is in progress. Leaving the page now will cancel the upload." => "O envío do ficheiro está en proceso. Saír agora da páxina cancelará o envío.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n ficheiro","%n ficheiros"),
"{dirs} and {files}" => "{dirs} e {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Cargando %n ficheiro","Cargando %n ficheiros"),
-"files uploading" => "ficheiros enviándose",
"'.' is an invalid file name." => "«.» é un nome de ficheiro incorrecto",
"File name cannot be empty." => "O nome de ficheiro non pode estar baleiro",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome incorrecto, non se permite «\\», «/», «<», «>», «:», «\"», «|», «?» e «*».",
diff --git a/apps/files/l10n/he.php b/apps/files/l10n/he.php
index 40d7cc9c552..bc7ecdb0716 100644
--- a/apps/files/l10n/he.php
+++ b/apps/files/l10n/he.php
@@ -11,10 +11,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "תקיה זמנית חסרה",
"Failed to write to disk" => "הכתיבה לכונן נכשלה",
"Not enough storage available" => "אין די שטח פנוי באחסון",
-"Upload failed" => "ההעלאה נכשלה",
"Invalid directory." => "תיקייה שגויה.",
"Files" => "קבצים",
-"Unable to upload your file as it is a directory or has 0 bytes" => "לא יכול להעלות את הקובץ מכיוון שזו תקיה או שמשקל הקובץ 0 בתים",
"Upload cancelled." => "ההעלאה בוטלה.",
"File upload is in progress. Leaving the page now will cancel the upload." => "מתבצעת כעת העלאת קבצים. עזיבה של העמוד תבטל את ההעלאה.",
"URL cannot be empty." => "קישור אינו יכול להיות ריק.",
@@ -32,7 +30,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("",""),
-"files uploading" => "קבצים בהעלאה",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "השם שגוי, אסור להשתמש בתווים '\\', '/', '<', '>', ':', '\"', '|', '?' ו־'*'.",
"Name" => "שם",
"Size" => "גודל",
diff --git a/apps/files/l10n/hi.php b/apps/files/l10n/hi.php
index 7d2baab607d..549c928320d 100644
--- a/apps/files/l10n/hi.php
+++ b/apps/files/l10n/hi.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("",""),
+"Upload" => "अपलोड ",
"Save" => "सहेजें"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files/l10n/hr.php b/apps/files/l10n/hr.php
index 57f1ad9700b..60f1da84409 100644
--- a/apps/files/l10n/hr.php
+++ b/apps/files/l10n/hr.php
@@ -7,7 +7,6 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Nedostaje privremeni direktorij",
"Failed to write to disk" => "Neuspjelo pisanje na disk",
"Files" => "Datoteke",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Nemoguće poslati datoteku jer je prazna ili je direktorij",
"Upload cancelled." => "Slanje poništeno.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Učitavanje datoteke. Napuštanjem stranice će prekinuti učitavanje.",
"Error" => "Greška",
@@ -21,7 +20,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("","",""),
"_%n file_::_%n files_" => array("","",""),
"_Uploading %n file_::_Uploading %n files_" => array("","",""),
-"files uploading" => "datoteke se učitavaju",
"Name" => "Ime",
"Size" => "Veličina",
"Modified" => "Zadnja promjena",
diff --git a/apps/files/l10n/hu_HU.php b/apps/files/l10n/hu_HU.php
index 66edbefbca5..5d313ff2488 100644
--- a/apps/files/l10n/hu_HU.php
+++ b/apps/files/l10n/hu_HU.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Hiányzik egy ideiglenes mappa",
"Failed to write to disk" => "Nem sikerült a lemezre történő írás",
"Not enough storage available" => "Nincs elég szabad hely.",
-"Upload failed" => "A feltöltés nem sikerült",
"Invalid directory." => "Érvénytelen mappa.",
"Files" => "Fájlok",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Nem tölthető fel, mert mappa volt, vagy 0 byte méretű",
"Not enough space available" => "Nincs elég szabad hely",
"Upload cancelled." => "A feltöltést megszakítottuk.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Fájlfeltöltés van folyamatban. Az oldal elhagyása megszakítja a feltöltést.",
@@ -36,7 +34,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("",""),
-"files uploading" => "fájl töltődik föl",
"'.' is an invalid file name." => "'.' fájlnév érvénytelen.",
"File name cannot be empty." => "A fájlnév nem lehet semmi.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Érvénytelen elnevezés. Ezek a karakterek nem használhatók: '\\', '/', '<', '>', ':', '\"', '|', '?' és '*'",
diff --git a/apps/files/l10n/id.php b/apps/files/l10n/id.php
index ce7cfe5ef4c..c8b3194eb6b 100644
--- a/apps/files/l10n/id.php
+++ b/apps/files/l10n/id.php
@@ -13,7 +13,6 @@ $TRANSLATIONS = array(
"Not enough storage available" => "Ruang penyimpanan tidak mencukupi",
"Invalid directory." => "Direktori tidak valid.",
"Files" => "Berkas",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Gagal mengunggah berkas Anda karena berupa direktori atau mempunyai ukuran 0 byte",
"Not enough space available" => "Ruang penyimpanan tidak mencukupi",
"Upload cancelled." => "Pengunggahan dibatalkan.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Berkas sedang diunggah. Meninggalkan halaman ini akan membatalkan proses.",
@@ -32,7 +31,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array(""),
"_%n file_::_%n files_" => array(""),
"_Uploading %n file_::_Uploading %n files_" => array(""),
-"files uploading" => "berkas diunggah",
"'.' is an invalid file name." => "'.' bukan nama berkas yang valid.",
"File name cannot be empty." => "Nama berkas tidak boleh kosong.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nama tidak valid, karakter '\\', '/', '<', '>', ':', '\"', '|', '?' dan '*' tidak diizinkan.",
diff --git a/apps/files/l10n/is.php b/apps/files/l10n/is.php
index 2cf195d0a11..ef493418206 100644
--- a/apps/files/l10n/is.php
+++ b/apps/files/l10n/is.php
@@ -12,7 +12,6 @@ $TRANSLATIONS = array(
"Failed to write to disk" => "Tókst ekki að skrifa á disk",
"Invalid directory." => "Ógild mappa.",
"Files" => "Skrár",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Innsending á skrá mistókst, hugsanlega sendir þú möppu eða skráin er 0 bæti.",
"Not enough space available" => "Ekki nægt pláss tiltækt",
"Upload cancelled." => "Hætt við innsendingu.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Innsending í gangi. Ef þú ferð af þessari síðu mun innsending misheppnast.",
diff --git a/apps/files/l10n/it.php b/apps/files/l10n/it.php
index b0ec954d907..c24d30ae368 100644
--- a/apps/files/l10n/it.php
+++ b/apps/files/l10n/it.php
@@ -13,12 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Manca una cartella temporanea",
"Failed to write to disk" => "Scrittura su disco non riuscita",
"Not enough storage available" => "Spazio di archiviazione insufficiente",
-"Upload failed" => "Caricamento non riuscito",
+"Upload failed. Could not get file info." => "Upload fallito. Impossibile ottenere informazioni sul file",
+"Upload failed. Could not find uploaded file" => "Upload fallit. Impossibile trovare file caricato",
"Invalid directory." => "Cartella non valida.",
"Files" => "File",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Impossibile caricare il file poiché è una cartella o ha una dimensione di 0 byte",
+"Unable to upload {filename} as it is a directory or has 0 bytes" => "Impossibile caricare {filename} poiché è una cartella oppure è di 0 byte",
"Not enough space available" => "Spazio disponibile insufficiente",
"Upload cancelled." => "Invio annullato",
+"Could not get result from server." => "Impossibile ottenere il risultato dal server.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Caricamento del file in corso. La chiusura della pagina annullerà il caricamento.",
"URL cannot be empty." => "L'URL non può essere vuoto.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nome della cartella non valido. L'uso di 'Shared' è riservato a ownCloud",
@@ -37,7 +39,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n file","%n file"),
"{dirs} and {files}" => "{dirs} e {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Caricamento di %n file in corso","Caricamento di %n file in corso"),
-"files uploading" => "caricamento file",
"'.' is an invalid file name." => "'.' non è un nome file valido.",
"File name cannot be empty." => "Il nome del file non può essere vuoto.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome non valido, '\\', '/', '<', '>', ':', '\"', '|', '?' e '*' non sono consentiti.",
@@ -45,6 +46,7 @@ $TRANSLATIONS = array(
"Your storage is almost full ({usedSpacePercent}%)" => "Lo spazio di archiviazione è quasi pieno ({usedSpacePercent}%)",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "La cifratura è stata disabilitata ma i tuoi file sono ancora cifrati. Vai nelle impostazioni personali per decifrare i file.",
"Your download is being prepared. This might take some time if the files are big." => "Il tuo scaricamento è in fase di preparazione. Ciò potrebbe richiedere del tempo se i file sono grandi.",
+"Error moving file" => "Errore durante lo spostamento del file",
"Name" => "Nome",
"Size" => "Dimensione",
"Modified" => "Modificato",
diff --git a/apps/files/l10n/ja_JP.php b/apps/files/l10n/ja_JP.php
index 5438cbb4976..5944b47434d 100644
--- a/apps/files/l10n/ja_JP.php
+++ b/apps/files/l10n/ja_JP.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "一時保存フォルダが見つかりません",
"Failed to write to disk" => "ディスクへの書き込みに失敗しました",
"Not enough storage available" => "ストレージに十分な空き容量がありません",
-"Upload failed" => "アップロードに失敗",
"Invalid directory." => "無効なディレクトリです。",
"Files" => "ファイル",
-"Unable to upload your file as it is a directory or has 0 bytes" => "ディレクトリもしくは0バイトのファイルはアップロードできません",
"Not enough space available" => "利用可能なスペースが十分にありません",
"Upload cancelled." => "アップロードはキャンセルされました。",
"File upload is in progress. Leaving the page now will cancel the upload." => "ファイル転送を実行中です。今このページから移動するとアップロードが中止されます。",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n個のファイル"),
"{dirs} and {files}" => "{dirs} と {files}",
"_Uploading %n file_::_Uploading %n files_" => array("%n 個のファイルをアップロード中"),
-"files uploading" => "ファイルをアップロード中",
"'.' is an invalid file name." => "'.' は無効なファイル名です。",
"File name cannot be empty." => "ファイル名を空にすることはできません。",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "無効な名前、'\\', '/', '<', '>', ':', '\"', '|', '?', '*' は使用できません。",
diff --git a/apps/files/l10n/ka_GE.php b/apps/files/l10n/ka_GE.php
index 455e3211a55..b9313957714 100644
--- a/apps/files/l10n/ka_GE.php
+++ b/apps/files/l10n/ka_GE.php
@@ -11,10 +11,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "დროებითი საქაღალდე არ არსებობს",
"Failed to write to disk" => "შეცდომა დისკზე ჩაწერისას",
"Not enough storage available" => "საცავში საკმარისი ადგილი არ არის",
-"Upload failed" => "ატვირთვა ვერ განხორციელდა",
"Invalid directory." => "დაუშვებელი დირექტორია.",
"Files" => "ფაილები",
-"Unable to upload your file as it is a directory or has 0 bytes" => "თქვენი ფაილის ატვირთვა ვერ მოხერხდა. ის არის საქაღალდე და შეიცავს 0 ბაიტს",
"Not enough space available" => "საკმარისი ადგილი არ არის",
"Upload cancelled." => "ატვირთვა შეჩერებულ იქნა.",
"File upload is in progress. Leaving the page now will cancel the upload." => "მიმდინარეობს ფაილის ატვირთვა. სხვა გვერდზე გადასვლა გამოიწვევს ატვირთვის შეჩერებას",
@@ -33,7 +31,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array(""),
"_%n file_::_%n files_" => array(""),
"_Uploading %n file_::_Uploading %n files_" => array(""),
-"files uploading" => "ფაილები იტვირთება",
"'.' is an invalid file name." => "'.' არის დაუშვებელი ფაილის სახელი.",
"File name cannot be empty." => "ფაილის სახელი არ შეიძლება იყოს ცარიელი.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "არადაშვებადი სახელი, '\\', '/', '<', '>', ':', '\"', '|', '?' და '*' არ არის დაიშვებული.",
diff --git a/apps/files/l10n/km.php b/apps/files/l10n/km.php
new file mode 100644
index 00000000000..70ab6572ba4
--- /dev/null
+++ b/apps/files/l10n/km.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array(""),
+"_%n file_::_%n files_" => array(""),
+"_Uploading %n file_::_Uploading %n files_" => array("")
+);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/apps/files/l10n/kn.php b/apps/files/l10n/kn.php
new file mode 100644
index 00000000000..70ab6572ba4
--- /dev/null
+++ b/apps/files/l10n/kn.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array(""),
+"_%n file_::_%n files_" => array(""),
+"_Uploading %n file_::_Uploading %n files_" => array("")
+);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/apps/files/l10n/ko.php b/apps/files/l10n/ko.php
index e2b787e7f91..502acefcf3a 100644
--- a/apps/files/l10n/ko.php
+++ b/apps/files/l10n/ko.php
@@ -11,10 +11,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "임시 폴더가 없음",
"Failed to write to disk" => "디스크에 쓰지 못했습니다",
"Not enough storage available" => "저장소가 용량이 충분하지 않습니다.",
-"Upload failed" => "업로드 실패",
"Invalid directory." => "올바르지 않은 디렉터리입니다.",
"Files" => "파일",
-"Unable to upload your file as it is a directory or has 0 bytes" => "디렉터리 및 빈 파일은 업로드할 수 없습니다",
"Not enough space available" => "여유 공간이 부족합니다",
"Upload cancelled." => "업로드가 취소되었습니다.",
"File upload is in progress. Leaving the page now will cancel the upload." => "파일 업로드가 진행 중입니다. 이 페이지를 벗어나면 업로드가 취소됩니다.",
@@ -33,7 +31,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array(""),
"_%n file_::_%n files_" => array(""),
"_Uploading %n file_::_Uploading %n files_" => array(""),
-"files uploading" => "파일 업로드중",
"'.' is an invalid file name." => "'.' 는 올바르지 않은 파일 이름 입니다.",
"File name cannot be empty." => "파일 이름이 비어 있을 수 없습니다.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "폴더 이름이 올바르지 않습니다. 이름에 문자 '\\', '/', '<', '>', ':', '\"', '|', '? ', '*'는 사용할 수 없습니다.",
diff --git a/apps/files/l10n/lb.php b/apps/files/l10n/lb.php
index deefe9caa15..cd68b2b9ad2 100644
--- a/apps/files/l10n/lb.php
+++ b/apps/files/l10n/lb.php
@@ -7,7 +7,6 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Et feelt en temporären Dossier",
"Failed to write to disk" => "Konnt net op den Disk schreiwen",
"Files" => "Dateien",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Kann deng Datei net eroplueden well et en Dossier ass oder 0 byte grouss ass.",
"Upload cancelled." => "Upload ofgebrach.",
"File upload is in progress. Leaving the page now will cancel the upload." => "File Upload am gaang. Wann's de des Säit verléiss gëtt den Upload ofgebrach.",
"Error" => "Fehler",
diff --git a/apps/files/l10n/lt_LT.php b/apps/files/l10n/lt_LT.php
index 83ed8e8688f..2b32a129d55 100644
--- a/apps/files/l10n/lt_LT.php
+++ b/apps/files/l10n/lt_LT.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Nėra laikinojo katalogo",
"Failed to write to disk" => "Nepavyko įrašyti į diską",
"Not enough storage available" => "Nepakanka vietos serveryje",
-"Upload failed" => "Nusiuntimas nepavyko",
"Invalid directory." => "Neteisingas aplankas",
"Files" => "Failai",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Neįmanoma įkelti failo - jo dydis gali būti 0 bitų arba tai katalogas",
"Not enough space available" => "Nepakanka vietos",
"Upload cancelled." => "Įkėlimas atšauktas.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Failo įkėlimas pradėtas. Jei paliksite šį puslapį, įkėlimas nutrūks.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n failas","%n failai","%n failų"),
"{dirs} and {files}" => "{dirs} ir {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Įkeliamas %n failas","Įkeliami %n failai","Įkeliama %n failų"),
-"files uploading" => "įkeliami failai",
"'.' is an invalid file name." => "'.' yra neleidžiamas failo pavadinime.",
"File name cannot be empty." => "Failo pavadinimas negali būti tuščias.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neleistinas pavadinimas, '\\', '/', '<', '>', ':', '\"', '|', '?' ir '*' yra neleidžiami.",
diff --git a/apps/files/l10n/lv.php b/apps/files/l10n/lv.php
index d24aaca9e4c..cefaea62818 100644
--- a/apps/files/l10n/lv.php
+++ b/apps/files/l10n/lv.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Trūkst pagaidu mapes",
"Failed to write to disk" => "Neizdevās saglabāt diskā",
"Not enough storage available" => "Nav pietiekami daudz vietas",
-"Upload failed" => "Neizdevās augšupielādēt",
"Invalid directory." => "Nederīga direktorija.",
"Files" => "Datnes",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Nevar augšupielādēt jūsu datni, jo tā ir direktorija vai arī tā ir 0 baitu liela",
"Not enough space available" => "Nepietiek brīvas vietas",
"Upload cancelled." => "Augšupielāde ir atcelta.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Notiek augšupielāde. Pametot lapu tagad, tiks atcelta augšupielāde.",
@@ -36,7 +34,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("%n mapes","%n mape","%n mapes"),
"_%n file_::_%n files_" => array("%n faili","%n fails","%n faili"),
"_Uploading %n file_::_Uploading %n files_" => array("%n","Augšupielāde %n failu","Augšupielāde %n failus"),
-"files uploading" => "fails augšupielādējas",
"'.' is an invalid file name." => "'.' ir nederīgs datnes nosaukums.",
"File name cannot be empty." => "Datnes nosaukums nevar būt tukšs.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nederīgs nosaukums, nav atļauti '\\', '/', '<', '>', ':', '\"', '|', '?' un '*'.",
diff --git a/apps/files/l10n/mk.php b/apps/files/l10n/mk.php
index 7a9a8641f80..2306db6921a 100644
--- a/apps/files/l10n/mk.php
+++ b/apps/files/l10n/mk.php
@@ -9,7 +9,6 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Недостасува привремена папка",
"Failed to write to disk" => "Неуспеав да запишам на диск",
"Files" => "Датотеки",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Не може да се преземе вашата датотека бидејќи фолдерот во кој се наоѓа фајлот има големина од 0 бајти",
"Upload cancelled." => "Преземањето е прекинато.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Подигање на датотека е во тек. Напуштење на страницата ќе го прекине.",
"URL cannot be empty." => "Адресата неможе да биде празна.",
diff --git a/apps/files/l10n/ml_IN.php b/apps/files/l10n/ml_IN.php
new file mode 100644
index 00000000000..0157af093e9
--- /dev/null
+++ b/apps/files/l10n/ml_IN.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array("",""),
+"_%n file_::_%n files_" => array("",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files/l10n/ms_MY.php b/apps/files/l10n/ms_MY.php
index 59d0bbfb339..61bbf81cd8a 100644
--- a/apps/files/l10n/ms_MY.php
+++ b/apps/files/l10n/ms_MY.php
@@ -8,7 +8,6 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Direktori sementara hilang",
"Failed to write to disk" => "Gagal untuk disimpan",
"Files" => "Fail-fail",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Tidak boleh memuatnaik fail anda kerana mungkin ianya direktori atau saiz fail 0 bytes",
"Upload cancelled." => "Muatnaik dibatalkan.",
"Error" => "Ralat",
"Share" => "Kongsi",
diff --git a/apps/files/l10n/nb_NO.php b/apps/files/l10n/nb_NO.php
index 55ce978d2a2..8fda251a2bc 100644
--- a/apps/files/l10n/nb_NO.php
+++ b/apps/files/l10n/nb_NO.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Mangler midlertidig mappe",
"Failed to write to disk" => "Klarte ikke å skrive til disk",
"Not enough storage available" => "Ikke nok lagringsplass",
-"Upload failed" => "Opplasting feilet",
"Invalid directory." => "Ugyldig katalog.",
"Files" => "Filer",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Kan ikke laste opp filen din siden det er en mappe eller den har 0 bytes",
"Not enough space available" => "Ikke nok lagringsplass",
"Upload cancelled." => "Opplasting avbrutt.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Filopplasting pågår. Forlater du siden nå avbrytes opplastingen.",
@@ -36,7 +34,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("%n mappe","%n mapper"),
"_%n file_::_%n files_" => array("%n fil","%n filer"),
"_Uploading %n file_::_Uploading %n files_" => array("Laster opp %n fil","Laster opp %n filer"),
-"files uploading" => "filer lastes opp",
"'.' is an invalid file name." => "'.' er et ugyldig filnavn.",
"File name cannot be empty." => "Filnavn kan ikke være tomt.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ugyldig navn, '\\', '/', '<', '>', ':', '\"', '|', '?' og '*' er ikke tillatt.",
diff --git a/apps/files/l10n/ne.php b/apps/files/l10n/ne.php
new file mode 100644
index 00000000000..0157af093e9
--- /dev/null
+++ b/apps/files/l10n/ne.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array("",""),
+"_%n file_::_%n files_" => array("",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files/l10n/nl.php b/apps/files/l10n/nl.php
index 8e9454e7945..65ad5265237 100644
--- a/apps/files/l10n/nl.php
+++ b/apps/files/l10n/nl.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Er ontbreekt een tijdelijke map",
"Failed to write to disk" => "Schrijven naar schijf mislukt",
"Not enough storage available" => "Niet genoeg opslagruimte beschikbaar",
-"Upload failed" => "Upload mislukt",
"Invalid directory." => "Ongeldige directory.",
"Files" => "Bestanden",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Het lukt niet om uw bestand te uploaded, omdat het een folder of 0 bytes is",
"Not enough space available" => "Niet genoeg ruimte beschikbaar",
"Upload cancelled." => "Uploaden geannuleerd.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Bestandsupload is bezig. Wanneer de pagina nu verlaten wordt, stopt de upload.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("","%n bestanden"),
"{dirs} and {files}" => "{dirs} en {files}",
"_Uploading %n file_::_Uploading %n files_" => array("%n bestand aan het uploaden","%n bestanden aan het uploaden"),
-"files uploading" => "bestanden aan het uploaden",
"'.' is an invalid file name." => "'.' is een ongeldige bestandsnaam.",
"File name cannot be empty." => "Bestandsnaam kan niet leeg zijn.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Onjuiste naam; '\\', '/', '<', '>', ':', '\"', '|', '?' en '*' zijn niet toegestaan.",
diff --git a/apps/files/l10n/nn_NO.php b/apps/files/l10n/nn_NO.php
index 58aafac27c4..04c47c31fbb 100644
--- a/apps/files/l10n/nn_NO.php
+++ b/apps/files/l10n/nn_NO.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Manglar ei mellombels mappe",
"Failed to write to disk" => "Klarte ikkje skriva til disk",
"Not enough storage available" => "Ikkje nok lagringsplass tilgjengeleg",
-"Upload failed" => "Feil ved opplasting",
"Invalid directory." => "Ugyldig mappe.",
"Files" => "Filer",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Klarte ikkje lasta opp fila sidan ho er ei mappe eller er på 0 byte",
"Not enough space available" => "Ikkje nok lagringsplass tilgjengeleg",
"Upload cancelled." => "Opplasting avbroten.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Fila lastar no opp. Viss du forlèt sida no vil opplastinga verta avbroten.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n fil","%n filer"),
"{dirs} and {files}" => "{dirs} og {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Lastar opp %n fil","Lastar opp %n filer"),
-"files uploading" => "filer lastar opp",
"'.' is an invalid file name." => "«.» er eit ugyldig filnamn.",
"File name cannot be empty." => "Filnamnet kan ikkje vera tomt.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ugyldig namn, «\\», «/», «<», «>», «:», «\"», «|», «?» og «*» er ikkje tillate.",
diff --git a/apps/files/l10n/nqo.php b/apps/files/l10n/nqo.php
new file mode 100644
index 00000000000..70ab6572ba4
--- /dev/null
+++ b/apps/files/l10n/nqo.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array(""),
+"_%n file_::_%n files_" => array(""),
+"_Uploading %n file_::_Uploading %n files_" => array("")
+);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/apps/files/l10n/oc.php b/apps/files/l10n/oc.php
index 63e572059bf..a6d8f91458e 100644
--- a/apps/files/l10n/oc.php
+++ b/apps/files/l10n/oc.php
@@ -7,7 +7,6 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Un dorsièr temporari manca",
"Failed to write to disk" => "L'escriptura sul disc a fracassat",
"Files" => "Fichièrs",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Impossible d'amontcargar lo teu fichièr qu'es un repertòri o que ten pas que 0 octet.",
"Upload cancelled." => "Amontcargar anullat.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Un amontcargar es a se far. Daissar aquesta pagina ara tamparà lo cargament. ",
"Error" => "Error",
@@ -21,7 +20,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("",""),
-"files uploading" => "fichièrs al amontcargar",
"Name" => "Nom",
"Size" => "Talha",
"Modified" => "Modificat",
diff --git a/apps/files/l10n/pa.php b/apps/files/l10n/pa.php
new file mode 100644
index 00000000000..d8c50f2d1bc
--- /dev/null
+++ b/apps/files/l10n/pa.php
@@ -0,0 +1,16 @@
+<?php
+$TRANSLATIONS = array(
+"Files" => "ਫਾਇਲਾਂ",
+"Error" => "ਗਲਤੀ",
+"Share" => "ਸਾਂਝਾ ਕਰੋ",
+"Rename" => "ਨਾਂ ਬਦਲੋ",
+"undo" => "ਵਾਪਸ",
+"_%n folder_::_%n folders_" => array("",""),
+"_%n file_::_%n files_" => array("",""),
+"_Uploading %n file_::_Uploading %n files_" => array("",""),
+"Upload" => "ਅੱਪਲੋਡ",
+"Cancel upload" => "ਅੱਪਲੋਡ ਰੱਦ ਕਰੋ",
+"Download" => "ਡਾਊਨਲੋਡ",
+"Delete" => "ਹਟਾਓ"
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files/l10n/pl.php b/apps/files/l10n/pl.php
index d8edf7173a8..3ad80975810 100644
--- a/apps/files/l10n/pl.php
+++ b/apps/files/l10n/pl.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Brak folderu tymczasowego",
"Failed to write to disk" => "Błąd zapisu na dysk",
"Not enough storage available" => "Za mało dostępnego miejsca",
-"Upload failed" => "Wysyłanie nie powiodło się",
"Invalid directory." => "Zła ścieżka.",
"Files" => "Pliki",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Nie można wczytać pliku, ponieważ jest on katalogiem lub ma 0 bajtów",
"Not enough space available" => "Za mało miejsca",
"Upload cancelled." => "Wczytywanie anulowane.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Wysyłanie pliku jest w toku. Jeśli opuścisz tę stronę, wysyłanie zostanie przerwane.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n plik","%n pliki","%n plików"),
"{dirs} and {files}" => "{katalogi} and {pliki}",
"_Uploading %n file_::_Uploading %n files_" => array("Wysyłanie %n pliku","Wysyłanie %n plików","Wysyłanie %n plików"),
-"files uploading" => "pliki wczytane",
"'.' is an invalid file name." => "„.” jest nieprawidłową nazwą pliku.",
"File name cannot be empty." => "Nazwa pliku nie może być pusta.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nieprawidłowa nazwa. Znaki '\\', '/', '<', '>', ':', '\"', '|', '?' oraz '*' są niedozwolone.",
diff --git a/apps/files/l10n/pt_BR.php b/apps/files/l10n/pt_BR.php
index f9915f251b4..cd960208565 100644
--- a/apps/files/l10n/pt_BR.php
+++ b/apps/files/l10n/pt_BR.php
@@ -13,12 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Pasta temporária não encontrada",
"Failed to write to disk" => "Falha ao escrever no disco",
"Not enough storage available" => "Espaço de armazenamento insuficiente",
-"Upload failed" => "Falha no envio",
+"Upload failed. Could not get file info." => "Falha no envio. Não foi possível obter informações do arquivo.",
+"Upload failed. Could not find uploaded file" => "Falha no envio. Não foi possível encontrar o arquivo enviado",
"Invalid directory." => "Diretório inválido.",
"Files" => "Arquivos",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Impossível enviar seus arquivo por ele ser um diretório ou ter 0 bytes.",
+"Unable to upload {filename} as it is a directory or has 0 bytes" => "Incapaz de fazer o envio de {filename}, pois é um diretório ou tem 0 bytes",
"Not enough space available" => "Espaço de armazenamento insuficiente",
"Upload cancelled." => "Envio cancelado.",
+"Could not get result from server." => "Não foi possível obter o resultado do servidor.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Upload em andamento. Sair da página agora resultará no cancelamento do envio.",
"URL cannot be empty." => "URL não pode ficar em branco",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nome de pasta inválido. O uso do nome 'Compartilhado' é reservado ao ownCloud",
@@ -37,7 +39,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n arquivo","%n arquivos"),
"{dirs} and {files}" => "{dirs} e {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Enviando %n arquivo","Enviando %n arquivos"),
-"files uploading" => "enviando arquivos",
"'.' is an invalid file name." => "'.' é um nome de arquivo inválido.",
"File name cannot be empty." => "O nome do arquivo não pode estar vazio.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome inválido, '\\', '/', '<', '>', ':', '\"', '|', '?' e '*' não são permitidos.",
@@ -45,6 +46,7 @@ $TRANSLATIONS = array(
"Your storage is almost full ({usedSpacePercent}%)" => "Seu armazenamento está quase cheio ({usedSpacePercent}%)",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Encriptação foi desabilitada mas seus arquivos continuam encriptados. Por favor vá a suas configurações pessoais para descriptar seus arquivos.",
"Your download is being prepared. This might take some time if the files are big." => "Seu download está sendo preparado. Isto pode levar algum tempo se os arquivos forem grandes.",
+"Error moving file" => "Erro movendo o arquivo",
"Name" => "Nome",
"Size" => "Tamanho",
"Modified" => "Modificado",
diff --git a/apps/files/l10n/pt_PT.php b/apps/files/l10n/pt_PT.php
index 33ec8cddce6..f6d61fc9873 100644
--- a/apps/files/l10n/pt_PT.php
+++ b/apps/files/l10n/pt_PT.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Está a faltar a pasta temporária",
"Failed to write to disk" => "Falhou a escrita no disco",
"Not enough storage available" => "Não há espaço suficiente em disco",
-"Upload failed" => "Carregamento falhou",
"Invalid directory." => "Directório Inválido",
"Files" => "Ficheiros",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Não é possível fazer o envio do ficheiro devido a ser uma pasta ou ter 0 bytes",
"Not enough space available" => "Espaço em disco insuficiente!",
"Upload cancelled." => "Envio cancelado.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Envio de ficheiro em progresso. Irá cancelar o envio se sair da página agora.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n ficheiro","%n ficheiros"),
"{dirs} and {files}" => "{dirs} e {files}",
"_Uploading %n file_::_Uploading %n files_" => array("A carregar %n ficheiro","A carregar %n ficheiros"),
-"files uploading" => "A enviar os ficheiros",
"'.' is an invalid file name." => "'.' não é um nome de ficheiro válido!",
"File name cannot be empty." => "O nome do ficheiro não pode estar vazio.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome Inválido, os caracteres '\\', '/', '<', '>', ':', '\"', '|', '?' e '*' não são permitidos.",
diff --git a/apps/files/l10n/ro.php b/apps/files/l10n/ro.php
index 0a96eaa2479..b1b9af45d38 100644
--- a/apps/files/l10n/ro.php
+++ b/apps/files/l10n/ro.php
@@ -13,12 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Lipsește un dosar temporar",
"Failed to write to disk" => "Eroare la scrierea discului",
"Not enough storage available" => "Nu este suficient spațiu disponibil",
-"Upload failed" => "Încărcarea a eșuat",
+"Upload failed. Could not get file info." => "Încărcare eșuată. Nu se pot obține informații despre fișier.",
+"Upload failed. Could not find uploaded file" => "Încărcare eșuată. Nu se poate găsi fișierul încărcat",
"Invalid directory." => "registru invalid.",
"Files" => "Fișiere",
-"Unable to upload your file as it is a directory or has 0 bytes" => "lista nu se poate incarca poate fi un fisier sau are 0 bytes",
+"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nu se poate încărca {filename} deoarece este un director sau are mărimea de 0 octeți",
"Not enough space available" => "Nu este suficient spațiu disponibil",
"Upload cancelled." => "Încărcare anulată.",
+"Could not get result from server." => "Nu se poate obține rezultatul de la server.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Fișierul este în curs de încărcare. Părăsirea paginii va întrerupe încărcarea.",
"URL cannot be empty." => "Adresa URL nu poate fi golita",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nume de dosar invalid. Utilizarea 'Shared' e rezervată de ownCloud",
@@ -33,10 +35,10 @@ $TRANSLATIONS = array(
"cancel" => "anulare",
"replaced {new_name} with {old_name}" => "{new_name} inlocuit cu {old_name}",
"undo" => "Anulează ultima acțiune",
-"_%n folder_::_%n folders_" => array("","",""),
-"_%n file_::_%n files_" => array("","",""),
-"_Uploading %n file_::_Uploading %n files_" => array("","",""),
-"files uploading" => "fișiere se încarcă",
+"_%n folder_::_%n folders_" => array("%n director","%n directoare","%n directoare"),
+"_%n file_::_%n files_" => array("%n fișier","%n fișiere","%n fișiere"),
+"{dirs} and {files}" => "{dirs} și {files}",
+"_Uploading %n file_::_Uploading %n files_" => array("Se încarcă %n fișier.","Se încarcă %n fișiere.","Se încarcă %n fișiere."),
"'.' is an invalid file name." => "'.' este un nume invalid de fișier.",
"File name cannot be empty." => "Numele fișierului nu poate rămâne gol.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nume invalide, '\\', '/', '<', '>', ':', '\"', '|', '?' si '*' nu sunt permise.",
@@ -44,6 +46,7 @@ $TRANSLATIONS = array(
"Your storage is almost full ({usedSpacePercent}%)" => "Spatiul de stocare este aproape plin {spatiu folosit}%",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "criptarea a fost disactivata dar fisierele sant inca criptate.va rog intrati in setarile personale pentru a decripta fisierele",
"Your download is being prepared. This might take some time if the files are big." => "in curs de descarcare. Aceasta poate să dureze ceva timp dacă fișierele sunt mari.",
+"Error moving file" => "Eroare la mutarea fișierului",
"Name" => "Nume",
"Size" => "Dimensiune",
"Modified" => "Modificat",
diff --git a/apps/files/l10n/ru.php b/apps/files/l10n/ru.php
index 96f52a9045c..143a3379ad4 100644
--- a/apps/files/l10n/ru.php
+++ b/apps/files/l10n/ru.php
@@ -13,12 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Отсутствует временная папка",
"Failed to write to disk" => "Ошибка записи на диск",
"Not enough storage available" => "Недостаточно доступного места в хранилище",
-"Upload failed" => "Ошибка загрузки",
+"Upload failed. Could not get file info." => "Загрузка не удалась. Невозможно получить информацию о файле",
+"Upload failed. Could not find uploaded file" => "Загрузка не удалась. Невозможно найти загруженный файл",
"Invalid directory." => "Неправильный каталог.",
"Files" => "Файлы",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Файл не был загружен: его размер 0 байт либо это не файл, а директория.",
+"Unable to upload {filename} as it is a directory or has 0 bytes" => "Невозможно загрузить файл {filename} так как он является директорией либо имеет размер 0 байт",
"Not enough space available" => "Недостаточно свободного места",
"Upload cancelled." => "Загрузка отменена.",
+"Could not get result from server." => "Не получен ответ от сервера",
"File upload is in progress. Leaving the page now will cancel the upload." => "Файл в процессе загрузки. Покинув страницу вы прервёте загрузку.",
"URL cannot be empty." => "Ссылка не может быть пустой.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Неправильное имя каталога. Имя 'Shared' зарезервировано.",
@@ -35,14 +37,16 @@ $TRANSLATIONS = array(
"undo" => "отмена",
"_%n folder_::_%n folders_" => array("%n папка","%n папки","%n папок"),
"_%n file_::_%n files_" => array("%n файл","%n файла","%n файлов"),
+"{dirs} and {files}" => "{dirs} и {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Закачка %n файла","Закачка %n файлов","Закачка %n файлов"),
-"files uploading" => "файлы загружаются",
"'.' is an invalid file name." => "'.' - неправильное имя файла.",
"File name cannot be empty." => "Имя файла не может быть пустым.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Неправильное имя, '\\', '/', '<', '>', ':', '\"', '|', '?' и '*' недопустимы.",
"Your storage is full, files can not be updated or synced anymore!" => "Ваше дисковое пространство полностью заполнено, произведите очистку перед загрузкой новых файлов.",
"Your storage is almost full ({usedSpacePercent}%)" => "Ваше хранилище почти заполнено ({usedSpacePercent}%)",
+"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Шифрование было отключено, но ваши файлы все еще зашифрованы. Пожалуйста, зайдите на страницу персональных настроек для того, чтобы расшифровать ваши файлы.",
"Your download is being prepared. This might take some time if the files are big." => "Загрузка началась. Это может потребовать много времени, если файл большого размера.",
+"Error moving file" => "Ошибка при перемещении файла",
"Name" => "Имя",
"Size" => "Размер",
"Modified" => "Изменён",
diff --git a/apps/files/l10n/si_LK.php b/apps/files/l10n/si_LK.php
index 1fd18d0c56f..7d24370a092 100644
--- a/apps/files/l10n/si_LK.php
+++ b/apps/files/l10n/si_LK.php
@@ -7,7 +7,6 @@ $TRANSLATIONS = array(
"No file was uploaded" => "ගොනුවක් උඩුගත නොවුණි",
"Missing a temporary folder" => "තාවකාලික ෆොල්ඩරයක් අතුරුදහන්",
"Failed to write to disk" => "තැටිගත කිරීම අසාර්ථකයි",
-"Upload failed" => "උඩුගත කිරීම අසාර්ථකයි",
"Files" => "ගොනු",
"Upload cancelled." => "උඩුගත කිරීම අත් හරින්න ලදී",
"File upload is in progress. Leaving the page now will cancel the upload." => "උඩුගතකිරීමක් සිදුවේ. පිටුව හැර යාමෙන් එය නැවතෙනු ඇත",
diff --git a/apps/files/l10n/sk.php b/apps/files/l10n/sk.php
new file mode 100644
index 00000000000..a3178a95c47
--- /dev/null
+++ b/apps/files/l10n/sk.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array("","",""),
+"_%n file_::_%n files_" => array("","",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","","")
+);
+$PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;";
diff --git a/apps/files/l10n/sk_SK.php b/apps/files/l10n/sk_SK.php
index b30f263d244..962ce7d7e9b 100644
--- a/apps/files/l10n/sk_SK.php
+++ b/apps/files/l10n/sk_SK.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Chýba dočasný priečinok",
"Failed to write to disk" => "Zápis na disk sa nepodaril",
"Not enough storage available" => "Nedostatok dostupného úložného priestoru",
-"Upload failed" => "Odoslanie bolo neúspešné",
"Invalid directory." => "Neplatný priečinok.",
"Files" => "Súbory",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Nedá sa odoslať Váš súbor, pretože je to priečinok, alebo je jeho veľkosť 0 bajtov",
"Not enough space available" => "Nie je k dispozícii dostatok miesta",
"Upload cancelled." => "Odosielanie zrušené.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Opustenie stránky zruší práve prebiehajúce odosielanie súboru.",
@@ -36,7 +34,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("%n priečinok","%n priečinky","%n priečinkov"),
"_%n file_::_%n files_" => array("%n súbor","%n súbory","%n súborov"),
"_Uploading %n file_::_Uploading %n files_" => array("Nahrávam %n súbor","Nahrávam %n súbory","Nahrávam %n súborov"),
-"files uploading" => "nahrávanie súborov",
"'.' is an invalid file name." => "'.' je neplatné meno súboru.",
"File name cannot be empty." => "Meno súboru nemôže byť prázdne",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nesprávne meno, '\\', '/', '<', '>', ':', '\"', '|', '?' a '*' nie sú povolené hodnoty.",
diff --git a/apps/files/l10n/sl.php b/apps/files/l10n/sl.php
index 08f789ff866..7190753eac9 100644
--- a/apps/files/l10n/sl.php
+++ b/apps/files/l10n/sl.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Manjka začasna mapa",
"Failed to write to disk" => "Pisanje na disk je spodletelo",
"Not enough storage available" => "Na voljo ni dovolj prostora",
-"Upload failed" => "Pošiljanje je spodletelo",
"Invalid directory." => "Neveljavna mapa.",
"Files" => "Datoteke",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Pošiljanja ni mogoče izvesti, saj gre za mapo oziroma datoteko velikosti 0 bajtov.",
"Not enough space available" => "Na voljo ni dovolj prostora.",
"Upload cancelled." => "Pošiljanje je preklicano.",
"File upload is in progress. Leaving the page now will cancel the upload." => "V teku je pošiljanje datoteke. Če zapustite to stran zdaj, bo pošiljanje preklicano.",
@@ -36,7 +34,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("","","",""),
"_%n file_::_%n files_" => array("","","",""),
"_Uploading %n file_::_Uploading %n files_" => array("","","",""),
-"files uploading" => "poteka pošiljanje datotek",
"'.' is an invalid file name." => "'.' je neveljavno ime datoteke.",
"File name cannot be empty." => "Ime datoteke ne sme biti prazno polje.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neveljavno ime, znaki '\\', '/', '<', '>', ':', '\"', '|', '?' in '*' niso dovoljeni.",
diff --git a/apps/files/l10n/sq.php b/apps/files/l10n/sq.php
index 3207e3a165c..ecc066a284c 100644
--- a/apps/files/l10n/sq.php
+++ b/apps/files/l10n/sq.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Një dosje e përkohshme nuk u gjet",
"Failed to write to disk" => "Ruajtja në disk dështoi",
"Not enough storage available" => "Nuk ka mbetur hapësirë memorizimi e mjaftueshme",
-"Upload failed" => "Ngarkimi dështoi",
"Invalid directory." => "Dosje e pavlefshme.",
"Files" => "Skedarët",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Nuk është i mundur ngarkimi i skedarit tuaj sepse është dosje ose ka dimension 0 byte",
"Not enough space available" => "Nuk ka hapësirë memorizimi e mjaftueshme",
"Upload cancelled." => "Ngarkimi u anulua.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Ngarkimi i skedarit është në vazhdim. Nqse ndërroni faqen tani ngarkimi do të anulohet.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n skedar","%n skedarë"),
"{dirs} and {files}" => "{dirs} dhe {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Po ngarkoj %n skedar","Po ngarkoj %n skedarë"),
-"files uploading" => "po ngarkoj skedarët",
"'.' is an invalid file name." => "'.' është emër i pavlefshëm.",
"File name cannot be empty." => "Emri i skedarit nuk mund të jetë bosh.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Emër i pavlefshëm, '\\', '/', '<', '>', ':', '\"', '|', '?' dhe '*' nuk lejohen.",
diff --git a/apps/files/l10n/sr.php b/apps/files/l10n/sr.php
index 73f8ace5c81..fd3b2a2912f 100644
--- a/apps/files/l10n/sr.php
+++ b/apps/files/l10n/sr.php
@@ -11,10 +11,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Недостаје привремена фасцикла",
"Failed to write to disk" => "Не могу да пишем на диск",
"Not enough storage available" => "Нема довољно простора",
-"Upload failed" => "Отпремање није успело",
"Invalid directory." => "неисправна фасцикла.",
"Files" => "Датотеке",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Не могу да отпремим датотеку као фасциклу или она има 0 бајтова",
"Not enough space available" => "Нема довољно простора",
"Upload cancelled." => "Отпремање је прекинуто.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Отпремање датотеке је у току. Ако сада напустите страницу, прекинућете отпремање.",
@@ -33,7 +31,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("","",""),
"_%n file_::_%n files_" => array("","",""),
"_Uploading %n file_::_Uploading %n files_" => array("","",""),
-"files uploading" => "датотеке се отпремају",
"'.' is an invalid file name." => "Датотека „.“ је неисправног имена.",
"File name cannot be empty." => "Име датотеке не може бити празно.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Неисправан назив. Следећи знакови нису дозвољени: \\, /, <, >, :, \", |, ? и *.",
diff --git a/apps/files/l10n/sr@latin.php b/apps/files/l10n/sr@latin.php
index 1965479fe66..8831d1a1bef 100644
--- a/apps/files/l10n/sr@latin.php
+++ b/apps/files/l10n/sr@latin.php
@@ -6,6 +6,8 @@ $TRANSLATIONS = array(
"No file was uploaded" => "Nijedan fajl nije poslat",
"Missing a temporary folder" => "Nedostaje privremena fascikla",
"Files" => "Fajlovi",
+"Error" => "Greška",
+"Share" => "Podeli",
"_%n folder_::_%n folders_" => array("","",""),
"_%n file_::_%n files_" => array("","",""),
"_Uploading %n file_::_Uploading %n files_" => array("","",""),
@@ -17,6 +19,7 @@ $TRANSLATIONS = array(
"Save" => "Snimi",
"Nothing in here. Upload something!" => "Ovde nema ničeg. Pošaljite nešto!",
"Download" => "Preuzmi",
+"Unshare" => "Ukljoni deljenje",
"Delete" => "Obriši",
"Upload too large" => "Pošiljka je prevelika",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Fajlovi koje želite da pošaljete prevazilaze ograničenje maksimalne veličine pošiljke na ovom serveru."
diff --git a/apps/files/l10n/sv.php b/apps/files/l10n/sv.php
index fbbe1f15910..208dcd4ea12 100644
--- a/apps/files/l10n/sv.php
+++ b/apps/files/l10n/sv.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "En temporär mapp saknas",
"Failed to write to disk" => "Misslyckades spara till disk",
"Not enough storage available" => "Inte tillräckligt med lagringsutrymme tillgängligt",
-"Upload failed" => "Misslyckad uppladdning",
"Invalid directory." => "Felaktig mapp.",
"Files" => "Filer",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Kan inte ladda upp din fil eftersom det är en katalog eller har 0 bytes",
"Not enough space available" => "Inte tillräckligt med utrymme tillgängligt",
"Upload cancelled." => "Uppladdning avbruten.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Filuppladdning pågår. Lämnar du sidan så avbryts uppladdningen.",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n fil","%n filer"),
"{dirs} and {files}" => "{dirs} och {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Laddar upp %n fil","Laddar upp %n filer"),
-"files uploading" => "filer laddas upp",
"'.' is an invalid file name." => "'.' är ett ogiltigt filnamn.",
"File name cannot be empty." => "Filnamn kan inte vara tomt.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ogiltigt namn, '\\', '/', '<', '>', ':', '\"', '|', '?' och '*' är inte tillåtet.",
diff --git a/apps/files/l10n/sw_KE.php b/apps/files/l10n/sw_KE.php
new file mode 100644
index 00000000000..0157af093e9
--- /dev/null
+++ b/apps/files/l10n/sw_KE.php
@@ -0,0 +1,7 @@
+<?php
+$TRANSLATIONS = array(
+"_%n folder_::_%n folders_" => array("",""),
+"_%n file_::_%n files_" => array("",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","")
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files/l10n/ta_LK.php b/apps/files/l10n/ta_LK.php
index 154e0d6796e..f05990b94f0 100644
--- a/apps/files/l10n/ta_LK.php
+++ b/apps/files/l10n/ta_LK.php
@@ -7,9 +7,7 @@ $TRANSLATIONS = array(
"No file was uploaded" => "எந்த கோப்பும் பதிவேற்றப்படவில்லை",
"Missing a temporary folder" => "ஒரு தற்காலிகமான கோப்புறையை காணவில்லை",
"Failed to write to disk" => "வட்டில் எழுத முடியவில்லை",
-"Upload failed" => "பதிவேற்றல் தோல்வியுற்றது",
"Files" => "கோப்புகள்",
-"Unable to upload your file as it is a directory or has 0 bytes" => "அடைவு அல்லது 0 bytes ஐ கொண்டுள்ளதால் உங்களுடைய கோப்பை பதிவேற்ற முடியவில்லை",
"Upload cancelled." => "பதிவேற்றல் இரத்து செய்யப்பட்டுள்ளது",
"File upload is in progress. Leaving the page now will cancel the upload." => "கோப்பு பதிவேற்றம் செயல்பாட்டில் உள்ளது. இந்தப் பக்கத்திலிருந்து வெறியேறுவதானது பதிவேற்றலை இரத்து செய்யும்.",
"URL cannot be empty." => "URL வெறுமையாக இருக்கமுடியாது.",
diff --git a/apps/files/l10n/th_TH.php b/apps/files/l10n/th_TH.php
index aa8cf4e9b50..37144ebc883 100644
--- a/apps/files/l10n/th_TH.php
+++ b/apps/files/l10n/th_TH.php
@@ -11,10 +11,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "โฟลเดอร์ชั่วคราวเกิดการสูญหาย",
"Failed to write to disk" => "เขียนข้อมูลลงแผ่นดิสก์ล้มเหลว",
"Not enough storage available" => "เหลือพื้นที่ไม่เพียงสำหรับใช้งาน",
-"Upload failed" => "อัพโหลดล้มเหลว",
"Invalid directory." => "ไดเร็กทอรี่ไม่ถูกต้อง",
"Files" => "ไฟล์",
-"Unable to upload your file as it is a directory or has 0 bytes" => "ไม่สามารถอัพโหลดไฟล์ของคุณได้ เนื่องจากไฟล์ดังกล่าวเป็นไดเร็กทอรี่ หรือ มีขนาดไฟล์ 0 ไบต์",
"Not enough space available" => "มีพื้นที่เหลือไม่เพียงพอ",
"Upload cancelled." => "การอัพโหลดถูกยกเลิก",
"File upload is in progress. Leaving the page now will cancel the upload." => "การอัพโหลดไฟล์กำลังอยู่ในระหว่างดำเนินการ การออกจากหน้าเว็บนี้จะทำให้การอัพโหลดถูกยกเลิก",
@@ -32,7 +30,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array(""),
"_%n file_::_%n files_" => array(""),
"_Uploading %n file_::_Uploading %n files_" => array(""),
-"files uploading" => "การอัพโหลดไฟล์",
"'.' is an invalid file name." => "'.' เป็นชื่อไฟล์ที่ไม่ถูกต้อง",
"File name cannot be empty." => "ชื่อไฟล์ไม่สามารถเว้นว่างได้",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "ชื่อที่ใช้ไม่ถูกต้อง, '\\', '/', '<', '>', ':', '\"', '|', '?' และ '*' ไม่ได้รับอนุญาตให้ใช้งานได้",
diff --git a/apps/files/l10n/tr.php b/apps/files/l10n/tr.php
index dd089757d5f..8cb05e16ace 100644
--- a/apps/files/l10n/tr.php
+++ b/apps/files/l10n/tr.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Geçici dizin eksik",
"Failed to write to disk" => "Diske yazılamadı",
"Not enough storage available" => "Yeterli disk alanı yok",
-"Upload failed" => "Yükleme başarısız",
"Invalid directory." => "Geçersiz dizin.",
"Files" => "Dosyalar",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Dosyanızın boyutu 0 byte olduğundan veya bir dizin olduğundan yüklenemedi",
"Not enough space available" => "Yeterli disk alanı yok",
"Upload cancelled." => "Yükleme iptal edildi.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Dosya yükleme işlemi sürüyor. Şimdi sayfadan ayrılırsanız işleminiz iptal olur.",
@@ -36,7 +34,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("%n dizin","%n dizin"),
"_%n file_::_%n files_" => array("%n dosya","%n dosya"),
"_Uploading %n file_::_Uploading %n files_" => array("%n dosya yükleniyor","%n dosya yükleniyor"),
-"files uploading" => "Dosyalar yükleniyor",
"'.' is an invalid file name." => "'.' geçersiz dosya adı.",
"File name cannot be empty." => "Dosya adı boş olamaz.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Geçersiz isim, '\\', '/', '<', '>', ':', '\"', '|', '?' ve '*' karakterlerine izin verilmemektedir.",
diff --git a/apps/files/l10n/ug.php b/apps/files/l10n/ug.php
index 920d077e4eb..a38ce706ef9 100644
--- a/apps/files/l10n/ug.php
+++ b/apps/files/l10n/ug.php
@@ -23,7 +23,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array(""),
"_%n file_::_%n files_" => array(""),
"_Uploading %n file_::_Uploading %n files_" => array(""),
-"files uploading" => "ھۆججەت يۈكلىنىۋاتىدۇ",
"Name" => "ئاتى",
"Size" => "چوڭلۇقى",
"Modified" => "ئۆزگەرتكەن",
diff --git a/apps/files/l10n/uk.php b/apps/files/l10n/uk.php
index bea1d930799..fac7cea529a 100644
--- a/apps/files/l10n/uk.php
+++ b/apps/files/l10n/uk.php
@@ -12,10 +12,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Відсутній тимчасовий каталог",
"Failed to write to disk" => "Невдалося записати на диск",
"Not enough storage available" => "Місця більше немає",
-"Upload failed" => "Помилка завантаження",
"Invalid directory." => "Невірний каталог.",
"Files" => "Файли",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Неможливо завантажити ваш файл тому, що він тека або файл розміром 0 байт",
"Not enough space available" => "Місця більше немає",
"Upload cancelled." => "Завантаження перервано.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Виконується завантаження файлу. Закриття цієї сторінки приведе до відміни завантаження.",
@@ -34,7 +32,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("","",""),
"_%n file_::_%n files_" => array("","",""),
"_Uploading %n file_::_Uploading %n files_" => array("","",""),
-"files uploading" => "файли завантажуються",
"'.' is an invalid file name." => "'.' це невірне ім'я файлу.",
"File name cannot be empty." => " Ім'я файлу не може бути порожнім.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Невірне ім'я, '\\', '/', '<', '>', ':', '\"', '|', '?' та '*' не дозволені.",
diff --git a/apps/files/l10n/vi.php b/apps/files/l10n/vi.php
index b98a14f6d7b..2d63128aa26 100644
--- a/apps/files/l10n/vi.php
+++ b/apps/files/l10n/vi.php
@@ -11,10 +11,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Không tìm thấy thư mục tạm",
"Failed to write to disk" => "Không thể ghi ",
"Not enough storage available" => "Không đủ không gian lưu trữ",
-"Upload failed" => "Tải lên thất bại",
"Invalid directory." => "Thư mục không hợp lệ",
"Files" => "Tập tin",
-"Unable to upload your file as it is a directory or has 0 bytes" => "Không thể tải lên tập tin của bạn ,nó như là một thư mục hoặc có 0 byte",
"Not enough space available" => "Không đủ chỗ trống cần thiết",
"Upload cancelled." => "Hủy tải lên",
"File upload is in progress. Leaving the page now will cancel the upload." => "Tập tin tải lên đang được xử lý. Nếu bạn rời khỏi trang bây giờ sẽ hủy quá trình này.",
@@ -33,7 +31,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array(""),
"_%n file_::_%n files_" => array(""),
"_Uploading %n file_::_Uploading %n files_" => array(""),
-"files uploading" => "tệp tin đang được tải lên",
"'.' is an invalid file name." => "'.' là một tên file không hợp lệ",
"File name cannot be empty." => "Tên file không được rỗng",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Tên không hợp lệ, '\\', '/', '<', '>', ':', '\"', '|', '?' và '*' thì không được phép dùng.",
diff --git a/apps/files/l10n/zh_CN.php b/apps/files/l10n/zh_CN.php
index 59b09ad950b..b739b72ce7e 100644
--- a/apps/files/l10n/zh_CN.php
+++ b/apps/files/l10n/zh_CN.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "缺少临时目录",
"Failed to write to disk" => "写入磁盘失败",
"Not enough storage available" => "没有足够的存储空间",
-"Upload failed" => "上传失败",
"Invalid directory." => "无效文件夹。",
"Files" => "文件",
-"Unable to upload your file as it is a directory or has 0 bytes" => "无法上传您的文件,文件夹或者空文件",
"Not enough space available" => "没有足够可用空间",
"Upload cancelled." => "上传已取消",
"File upload is in progress. Leaving the page now will cancel the upload." => "文件正在上传中。现在离开此页会导致上传动作被取消。",
@@ -36,7 +34,6 @@ $TRANSLATIONS = array(
"_%n folder_::_%n folders_" => array("%n 文件夹"),
"_%n file_::_%n files_" => array("%n个文件"),
"_Uploading %n file_::_Uploading %n files_" => array(""),
-"files uploading" => "文件上传中",
"'.' is an invalid file name." => "'.' 是一个无效的文件名。",
"File name cannot be empty." => "文件名不能为空。",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "无效名称,'\\', '/', '<', '>', ':', '\"', '|', '?' 和 '*' 不被允许使用。",
diff --git a/apps/files/l10n/zh_TW.php b/apps/files/l10n/zh_TW.php
index 21c929f81a6..214812d7ada 100644
--- a/apps/files/l10n/zh_TW.php
+++ b/apps/files/l10n/zh_TW.php
@@ -13,10 +13,8 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "找不到暫存資料夾",
"Failed to write to disk" => "寫入硬碟失敗",
"Not enough storage available" => "儲存空間不足",
-"Upload failed" => "上傳失敗",
"Invalid directory." => "無效的資料夾",
"Files" => "檔案",
-"Unable to upload your file as it is a directory or has 0 bytes" => "無法上傳您的檔案,因為它可能是一個目錄或檔案大小為0",
"Not enough space available" => "沒有足夠的可用空間",
"Upload cancelled." => "上傳已取消",
"File upload is in progress. Leaving the page now will cancel the upload." => "檔案上傳中,離開此頁面將會取消上傳。",
@@ -37,7 +35,6 @@ $TRANSLATIONS = array(
"_%n file_::_%n files_" => array("%n 個檔案"),
"{dirs} and {files}" => "{dirs} 和 {files}",
"_Uploading %n file_::_Uploading %n files_" => array("%n 個檔案正在上傳"),
-"files uploading" => "檔案上傳中",
"'.' is an invalid file name." => "'.' 是不合法的檔名",
"File name cannot be empty." => "檔名不能為空",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "檔名不合法,不允許 \\ / < > : \" | ? * 字元",
diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php
index 3c13b8ea6e2..08c807d7f7b 100644
--- a/apps/files/lib/helper.php
+++ b/apps/files/lib/helper.php
@@ -1,6 +1,6 @@
<?php
-namespace OCA\files\lib;
+namespace OCA\Files;
class Helper
{
@@ -85,11 +85,11 @@ class Helper
}
$i['directory'] = $dir;
$i['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($i['mimetype']);
- $i['icon'] = \OCA\files\lib\Helper::determineIcon($i);
+ $i['icon'] = \OCA\Files\Helper::determineIcon($i);
$files[] = $i;
}
- usort($files, array('\OCA\files\lib\Helper', 'fileCmp'));
+ usort($files, array('\OCA\Files\Helper', 'fileCmp'));
return $files;
}
diff --git a/apps/files/templates/fileexists.html b/apps/files/templates/fileexists.html
new file mode 100644
index 00000000000..662177ac7ed
--- /dev/null
+++ b/apps/files/templates/fileexists.html
@@ -0,0 +1,26 @@
+<div id="{dialog_name}" title="{title}" class="fileexists">
+ <span class="why">{why}<!-- Which files do you want to keep --></span><br/>
+ <span class="what">{what}<!-- If you select both versions, the copied file will have a number added to its name. --></span><br/>
+ <br/>
+ <table>
+ <th><label><input class="allnewfiles" type="checkbox" />New Files<span class="count"></span></label></th>
+ <th><label><input class="allexistingfiles" type="checkbox" />Already existing files<span class="count"></span></label></th>
+ </table>
+ <div class="conflicts">
+ <div class="template">
+ <div class="filename"></div>
+ <div class="replacement">
+ <input type="checkbox" />
+ <span class="svg icon"></span>
+ <div class="mtime"></div>
+ <div class="size"></div>
+ </div>
+ <div class="original">
+ <input type="checkbox" />
+ <span class="svg icon"></span>
+ <div class="mtime"></div>
+ <div class="size"></div>
+ </div>
+ </div>
+ </div>
+</div>