Nextcloud version (eg, 20.0.5): 24.0.2
Operating system and version (eg, Ubuntu 20.04): Not sure. I’m running this on a Bluehost share and don’t know how to determine that.
Apache or nginx version (eg, Apache 2.4.25): Same as previous answer.
PHP version (eg, 7.4): 7.3.33
The issue you are facing:
I have a basic NextCloud set up with a public shared upload folder, which I’ve set up to allow people to upload their photos and videos of an event. Photo upload works fine, but when trying to upload a video file, the error “Could not upload [filename]” appears. Interestingly, it doesn’t seem to be a file size problem, since if I try to upload a very small video file or a file with, say, a .css or .sh extension, I get the same error. .txt files work. If I take a file that won’t upload and change it to a file type that will upload (ex. mp4 → jpg), the file appears to upload fine, but then I get the “Could not upload” error at the end of the upload process, and the file does not appear in the uploads folder.
I tried installing the File Access Control app, but that only allows me to block certain file types, not allow types that are otherwise blocked, so I disabled it.
I also checked with Bluehost, and none of their restricted file types include the ones that are giving me trouble, so I don’t think it’s an issue with the hosting server.
There is nothing in the logger that points to a problem, even when I have the logging level set to 0.
I’m brand new to NextCloud, so I’d appreciate any advice the community can provide. Thanks!
Is this the first time you’ve seen this error? (Y/N): Yes, but I’m new to NextCloud, so this is the first time I’ve seen everything.
Steps to replicate it:
- Install NextCloud on a Bluehost share using the Web Installer and keeping the defaults.
- Set up a public shared upload folder for anonymous uploads, as described here: Making anonymous uploads — Nextcloud latest User Manual latest documentation
- Try to drag and drop various file types. Image and text files should work. Other file types should not.
The output of your Nextcloud log in Admin > Logging:
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'instanceid' => {instanceid},
'passwordsalt' => {passwordsalt},
'secret' => {secret},
'trusted_domains' =>
array (
0 => 'mydomain.com',
),
'datadirectory' => '/home4/{username}/public_html/nextcloud/data',
'dbtype' => 'sqlite3',
'version' => '24.0.2.1',
'overwrite.cli.url' => 'https://mydomain.com/nextcloud',
'installed' => true,
"loglevel" => 0,
'mail_from_address' => {mail_from_address},
'mail_smtpmode' => 'smtp',
'mail_sendmailmode' => 'smtp',
'mail_domain' => 'gmail.com',
'mail_smtpsecure' => 'ssl',
'mail_smtphost' => 'smtp.gmail.com',
);
The output of your Apache/nginx/system log in /var/log/____
:
Since I’m on a Bluehost share, I don’t have this.
Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.
Nothing appears in the logger in response to a failed upload. Here are the errors that have appeared in the log since I first set up NextCloud:
Error no app in context Exception: OC\Files\Storage\Local::calculateEtag(): Argument #2 ($stat) must be of type array, bool given, called in /home4/{username}/public_html/nextcloud/lib/private/Files/Storage/Local.php on line 505 in file '/home4/{username}/public_html/nextcloud/lib/private/Files/Storage/Local.php' line 508
Error index OCP\Files\NotPermittedException: Could not create folder
Error index OCP\Files\NotPermittedException: Could not create folder
Error index OCP\Files\NotPermittedException: Could not create folder