if ($lengthHeader && $this->request->getMethod() === 'PUT') {
$expected = (int)$lengthHeader;
if ($count !== $expected) {
throw new BadRequest(
$this->l10n->t(
'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.',
[
$this->l10n->n('%n byte', '%n bytes', $expected),
$this->l10n->n('%n byte', '%n bytes', $count),
],
)
);
}
if ($expected >= 0
&& $expected !== $count
&& $this->request->getMethod() === 'PUT'
) {
throw new BadRequest(
$this->l10n->t(
'Expected filesize of %1$s but read (from Nextcloud client) and wrote (to Nextcloud storage) %2$s. Could either be a network problem on the sending side or a problem writing to the storage on the server side.',
When User"user0"uploadsfile"data/textfile.txt"to"/testquota/asdf.txt"
Then theHTTPstatuscodeshouldbe"201"
Scenario: Uploading a file with very long filename
Given usingnewdavpath
And Asan"admin"
And user"user0"exists
And user"user0"hasaquotaof"10MB"
And Asan"user0"
When User"user0"uploadsfile"data/textfile.txt"to"/long-filename-with-250-characters-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.txt"
Then theHTTPstatuscodeshouldbe"201"
Scenario: Uploading a file with a too long filename
Given usingnewdavpath
And Asan"admin"
And user"user0"exists
And user"user0"hasaquotaof"10MB"
And Asan"user0"
When User"user0"uploadsfile"data/textfile.txt"to"/long-filename-with-251-characters-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.txt"
Then theHTTPstatuscodeshouldbe"400"
Scenario: Create a search query on image
Given usingnewdavpath
And Asan"admin"
@ -132,3 +150,14 @@ Feature: dav-v2
Then Favoritesearchshouldwork
And thesingleresponseshouldcontainaproperty"{http://owncloud.org/ns}favorite"withvalue"1"
Scenario: Create a search query on favorite
Given usingnewdavpath
And Asan"admin"
And user"user0"exists
And Asan"user0"
When User"user0"uploadsfile"data/green-square-256.png"to"/fav_image.png"
Then Favoritesearchshouldwork
And theresponseshouldbeempty
When user"user0"favoriteselement"/fav_image.png"
Then Favoritesearchshouldwork
And thesingleresponseshouldcontainaproperty"{http://owncloud.org/ns}favorite"withvalue"1"