# Error uploading file "avatar.jpg": Upload failed. Can not find uploaded file

**URL:** <https://help.nextcloud.com/t/error-uploading-file-avatar-jpg-upload-failed-can-not-find-uploaded-file/4255>\
**Category:** ℹ️ Support\
**Created:** [October 17, 2016, 12:35pm UTC](https://help.nextcloud.com/t/error-uploading-file-avatar-jpg-upload-failed-can-not-find-uploaded-file/4255 "2016-10-17T12:35:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sami](https://help.nextcloud.com/letter_avatar/sami/32/5_5575768a8748004e209b776fc1b2916d.png) [@sami](https://help.nextcloud.com/u/sami)\
**Post date:** [October 17, 2016, 12:35pm UTC](https://help.nextcloud.com/t/error-uploading-file-avatar-jpg-upload-failed-can-not-find-uploaded-file/4255/1 "2016-10-17T12:35:05Z")

</div>

Hello,  
now I have the next problem with my cloud.

After a server restart write the cloud by a upload.  
`Error uploading file "avatar.jpg": Upload failed. Can not find uploaded file.`

Can somebody help me.

Thank you in advance.

Best regards  
Christoph

---

<div class="post-metadata">

**Author:** ![sami](https://help.nextcloud.com/letter_avatar/sami/32/5_5575768a8748004e209b776fc1b2916d.png) [@sami](https://help.nextcloud.com/u/sami)\
**Post date:** [October 17, 2016, 2:33pm UTC](https://help.nextcloud.com/t/error-uploading-file-avatar-jpg-upload-failed-can-not-find-uploaded-file/4255/2 "2016-10-17T14:33:35Z")

</div>

Hello again,  
now I have found the data but I would like to copy the files to the 2TB HDD.

I have use this commands:  
`cp` -r /media/nextcloud/\* /media/mypc/HDD-Name/nextcloud-data/`

After that i have change in the config.php from  
`'datadirectory' => '/media/nextcloud'`

to  
`'datadirectory' => '/media/mypc/HDD-Name/nextcloud-data/'`.

Now the cloud are doesn’t work.

She write:  
Data directory (/media/mypc/HDD-Name/nextcloud-data) is invalid  
Please check that the data directory contains a file “.ocdata” in its root.

The .ocdata file are in the nextcloud-data.

Why is doesn’t work?

Best regards,  
Christoph

---

<div class="post-metadata">

**Author:** ![anon58843897](https://help.nextcloud.com/letter_avatar/anon58843897/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon58843897](https://help.nextcloud.com/u/anon58843897)\
**Post date:** [October 17, 2016, 3:52pm UTC](https://help.nextcloud.com/t/error-uploading-file-avatar-jpg-upload-failed-can-not-find-uploaded-file/4255/3 "2016-10-17T15:52:35Z")

</div>

I’m guessing you have a permission issue. Is the user, Nextcloud is running as, able to access the files at the new location?

Also, did you update the oc\_storage table in database? For instructions on moving the data directory, see [Is there a safe and reliable way to move data directory out of web root?](https://help.nextcloud.com/t/is-there-a-safe-and-reliable-way-to-move-data-directory-out-of-web-root/3642/9?u=grouchysysadmin). Those steps worked for me, but keep in mind that it is not supported and may not work in all cases.

---

<div class="post-metadata">

**Author:** ![sami](https://help.nextcloud.com/letter_avatar/sami/32/5_5575768a8748004e209b776fc1b2916d.png) [@sami](https://help.nextcloud.com/u/sami)\
**Post date:** [October 17, 2016, 4:23pm UTC](https://help.nextcloud.com/t/error-uploading-file-avatar-jpg-upload-failed-can-not-find-uploaded-file/4255/4 "2016-10-17T16:23:34Z")

</div>

Hello,  
thank you for the link.

Now I have change the link in oc\_storage, controll again in config.php, restart apache, and doesn’t work.

The cloud give me these infos:

```
Data directory (/media/mypc/HDD-Name/nextcloud-data) is invalid
Please check that the data directory contains a file ".ocdata" in its root.
				
Cannot create "data" directory (/media/mypc/HDD-Name/nextcloud-data)
This can usually be fixed by giving the webserver write access to the root directory.

```

I use these code for the permission:  
a) sudo chown www-data /media/mypc/HDD-Name/nextcloud-data  
b) chown www-data:root /media/mypc/HDD-Name/nextcloud-data

I don’t know why is the problem.

Best regards,  
Christoph

---

<div class="post-metadata">

**Author:** ![wollo](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wollo/32/321_2.png) [@wollo](https://help.nextcloud.com/u/wollo)\
**Post date:** [October 17, 2016, 4:56pm UTC](https://help.nextcloud.com/t/error-uploading-file-avatar-jpg-upload-failed-can-not-find-uploaded-file/4255/5 "2016-10-17T16:56:01Z")

</div>

Did you try

> _sudo chown -R www-data /media/mypc/HDD-Name/nextcloud-data_

so that all files under this sub directory have this permission?  
is there a file .ocdata in this subdirectory ?  
Try

> ls /media/mypc/HDD-Name/nextcloud-data/.ocdata\_

is it availlable

---

<div class="post-metadata">

**Author:** ![sami](https://help.nextcloud.com/letter_avatar/sami/32/5_5575768a8748004e209b776fc1b2916d.png) [@sami](https://help.nextcloud.com/u/sami)\
**Post date:** [October 17, 2016, 5:17pm UTC](https://help.nextcloud.com/t/error-uploading-file-avatar-jpg-upload-failed-can-not-find-uploaded-file/4255/6 "2016-10-17T17:17:51Z")

</div>

Regarding,  
The .ocdata\_ file doesn’t copy from the other disk.  
I created manuell and is normaly not viewed.

I mus take the shortcut strg+h  
After that I can see the .ocdata\_

If I use nur shell code ls /media/mypc/HDD-Name/nextcloud-data/.ocdata\_ I don’t get any information from the shell.

Best regards,  
Christoph

---

<div class="post-metadata">

**Author:** ![Schnello](https://help.nextcloud.com/user_avatar/help.nextcloud.com/schnello/32/14954_2.png) [@Schnello](https://help.nextcloud.com/u/Schnello)\
**Post date:** [October 19, 2016, 7:45pm UTC](https://help.nextcloud.com/t/error-uploading-file-avatar-jpg-upload-failed-can-not-find-uploaded-file/4255/7 "2016-10-19T19:45:17Z")

</div>

.ocdata\*\*\_\*\* ?

It should be “.ocdata” …

```auto
root@uplink:/home/nas# ls -a /media/500_1/nextcloud/data/.ocdata
/media/500_1/nextcloud/data/.ocdata
```

Regards,  
Christian

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [November 6, 2024, 8:51pm UTC](https://help.nextcloud.com/t/error-uploading-file-avatar-jpg-upload-failed-can-not-find-uploaded-file/4255/8 "2024-11-06T20:51:36Z")

</div>

wwe: close old topics

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [January 24, 2025, 6:27pm UTC](https://help.nextcloud.com/t/error-uploading-file-avatar-jpg-upload-failed-can-not-find-uploaded-file/4255/9 "2025-01-24T18:27:30Z")

</div>


