When uploading a eicar file (file that is marked as a virus) the android app returns "upload failed - Snsupported Media Type".
When uploading an infected file, the user is given a clear feedback and the applications stops from trying to upload that file agian.
Can this problem be reproduced with the official owncloud server?
(url: https://demo.owncloud.org, user: test, password: test)
No, does not seem to have virus (ClamAV enabled)
Android version:
Galaxy s5.
Device model:
Stock or customized system:
customized
ownCloud app version:
2.4.0
ownCloud server version:
9.1.5
Insert your webserver log here
Exception: {"Message":"HTTP\/1.1 415 Virus Eicar-Test-Signature is detected in the file. Upload cannot be completed.","Exception":"OCA\\DAV\\Connector\\Sabre\\Exception\\UnsupportedMediaType","Code":0,"Trace":"#0 \/var\/www\/html\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php(157): OCA\\DAV\\Connector\\Sabre\\File->convertToSabreException(Object(OCP\\Files\\InvalidContentException))\n#1 \/var\/www\/html\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(1070): OCA\\DAV\\Connector\\Sabre\\File->put(Resource id #712)\n#2 \/var\/www\/html\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(511): Sabre\\DAV\\Server->updateFile('virus.txt', Resource id #712, NULL)\n#3 [internal function]: Sabre\\DAV\\CorePlugin->httpPut(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#4 \/var\/www\/html\/owncloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#5 \/var\/www\/html\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:PUT', Array)\n#6 \/var\/www\/html\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#7 \/var\/www\/html\/owncloud\/apps\/dav\/appinfo\/v1\/webdav.php(61): Sabre\\DAV\\Server->exec()\n#8 \/var\/www\/html\/owncloud\/remote.php(164): require_once('\/var\/www\/html\/o...')\n#9 {main}","File":"\/var\/www\/html\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php","Line":538,"User":"FC8C390C-9B01-47A6-ACEA-91391133E287"}
Hi @Emil-G , thank you for reporting this behaviour. We already have an issue to include feedback improvements but it's not scheduled for the next Android app release (2.5.0), we will work on it in the coming releases after the next one.
Hello again @Emil-G , we have reprioritized this issue and its fix will definitely be included in the next Android app release, 2.5.0. Sorry for the inconvenience.
@davigonz Thats good news! cheers!
@davigonz Does the oC API respond with an appropriate error message, like if I try to share, but don't have share permission, or is there room for improvement on the server side too?
00007758
@Emil-G Hello, I've tried to upload an eicar file to check the error message returned from the server ,which @michaelstingl refers to, but the upload is completed successfully and there's no error like the one you comment. Have a look at the gif below:

Is your eicar file different to the one I'm using?
Thank you
Do not take into account my previous comment, I was not using a proper antivirus configuration. Let me set the needed params and I will give you more details.
@michaelstingl I've finally managed to reproduce the described behaviour and the oC API responds with this error message "Virus Eicar-Test-Signature is detected in the file. Upload cannot be completed", which is appropriate and specific. This message is included in the body response, so I can parse it and show it easily.
Most helpful comment
@michaelstingl I've finally managed to reproduce the described behaviour and the oC API responds with this error message "Virus Eicar-Test-Signature is detected in the file. Upload cannot be completed", which is appropriate and specific. This message is included in the body response, so I can parse it and show it easily.