summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-10-28 11:22:34 +0100
committerVincent Petry <pvince81@owncloud.com>2013-10-28 14:14:55 +0100
commite62ca4ea4fc235d7ec767034a80889b2fa331e97 (patch)
tree545a37abaf90d57cccbb99fcf660331372a9ffc4 /apps/files/ajax
parentc61d328ab9696a620b623fb2dfd1622eb0363dc4 (diff)
downloadnextcloud-server-e62ca4ea4fc235d7ec767034a80889b2fa331e97.tar.gz
nextcloud-server-e62ca4ea4fc235d7ec767034a80889b2fa331e97.zip
Append file etag to preview URLs
Fixes #5534
Diffstat (limited to 'apps/files/ajax')
-rw-r--r--apps/files/ajax/newfile.php3
-rw-r--r--apps/files/ajax/upload.php2
2 files changed, 4 insertions, 1 deletions
diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php
index eed0047fc81..9d9a81ae3dc 100644
--- a/apps/files/ajax/newfile.php
+++ b/apps/files/ajax/newfile.php
@@ -89,7 +89,7 @@ if($source) {
$meta = \OC\Files\Filesystem::getFileInfo($target);
$mime=$meta['mimetype'];
$id = $meta['fileid'];
- $eventSource->send('success', array('mime'=>$mime, 'size'=>\OC\Files\Filesystem::filesize($target), 'id' => $id));
+ $eventSource->send('success', array('mime'=>$mime, 'size'=>\OC\Files\Filesystem::filesize($target), 'id' => $id, 'etag' => $meta['etag']));
} else {
$eventSource->send('error', $l10n->t('Error while downloading %s to %s', array($source, $target)));
}
@@ -119,6 +119,7 @@ if($source) {
'mime' => $mime,
'size' => $size,
'content' => $content,
+ 'etag' => $meta['etag']
)));
exit();
}
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 38c2a053a9e..0e905f993ac 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -132,6 +132,7 @@ if (strpos($dir, '..') === false) {
'size' => $meta['size'],
'id' => $meta['fileid'],
'name' => basename($target),
+ 'etag' => $meta['etag'],
'originalname' => $files['tmp_name'][$i],
'uploadMaxFilesize' => $maxUploadFileSize,
'maxHumanFilesize' => $maxHumanFileSize,
@@ -158,6 +159,7 @@ if (strpos($dir, '..') === false) {
'size' => $meta['size'],
'id' => $meta['fileid'],
'name' => basename($target),
+ 'etag' => $meta['etag'],
'originalname' => $files['tmp_name'][$i],
'uploadMaxFilesize' => $maxUploadFileSize,
'maxHumanFilesize' => $maxHumanFileSize,