The file name is changed when uploading from iPhone

When I upload a photo file from my iPhone, the file name changes. Normally, the image file name would be “img_0001.jpg”, but when I upload it to NC, it uploads with a file name like “0EF5FD5C-5988-4553-A054-B1822CF35B60.jpeg”. This happens on iOS devices, but not on Android devices.

If I use the NC app instead of web browsers, it seems to keep the original file name by setting it in the options. When a user uploads a file using any web browsers instead of using the NC app, is there any way to keep the original file name and complete the upload?

Nextcloud 22.2.0, PHP 8.0, nginx 1.20.1

1 Like


I did not get the story of your posting.

Are you using the official NC iOS app to upload?
Or other software?

Please re-read your posting and improve. So someone can help you.

Basically we are not using official NC app. Please don’t ask why.

When we upload images to Nextcloud by iOS devices, the file names will be different.

ex) img_0001.jpg → 0EF5FD5C-5988-4553-A054-B1822CF35B60.jpeg

What app are you using then? I doubt that this is a Nextcloud issue. And if so, then only in combination with this specific app…

I checked with “Mobile Safari, Chrome, iCab, Firefox”. Is this a problem with the iOS specifications rather than web browser?

Does that mean you upload the files via browser from your iOS devices?

That does not make any diffrence, because they all have to use the Safari / WebKit engine in the background. Apple does not allow to install other browser engines on iOS devices, besides its own.

On the other hand, if others upload images to NC using a web browser on an iOS device, what name will be given to the images and uploaded to NC?

In the official NC app for iOS, there is a setting item “Keep original file name” in the settings when uploading files. This means that the developer will know that the file name may change.

First of all what you describe should not happen with any client or browser on any device. However, until you tell us exactly how these files were uploaded, we can’t give you a definitive answer as to what is causing the issue.

I assume that the files were renamed during the upload. You can check this easily by logging into Nextcloud on a PC. If the files then also show these cryptic names, they were stored on the Nextcloud like this when they were uploaded. This would mean that the browser or the app with which the files were uploaded caused this error.

Is it possible that you are using an app that does encrypt the files before they get uploaded? Then this behavior would be normal…

How did I upload the files?
I uploaded the files according to the web UI as normal. I didn’t do anything unusual at all. At this time, no error is output to the NC log. I do not currently have encryption.

I think it is some issue with how iOS handels file uploads via the browser engine. This is probably not even a bug, but a (security) fetaure of iOS. :wink: I found an issue on GitHub where some users seem to have the same problem… Uploading multiple files at once not working on mobile Safari · Issue #1859 · nextcloud/server · GitHub And if you do a little googleing you will find other cases with similiar issues while uploading files to Dropbox or other providers…

The best option to work arround this would probably be to use the official Nextcloud iOS app. If that for some reason is not an option, you could maybe connect your device directly via WebDAV to the server (alltough i’m not sure if iOS allows that or offers such an option…) or maybe you could use some 3rd party app that supports WebDAV…

Facing exact same issue here while uploading photos from iPhone (13, iOS 15) to my nextcloud instance using auto-upload feature from the latest version of the Nextcloud app for iOS.

No you’re not. OP was specifically talking about uploads via browser, and there is probably not much the Nextcloud devs could do, becacuse it seems that’s just how iOS handles file uploads via it’s browser engine. In the Nextcloud app however, there is a toggle in the “Auto Upload” section called “Keep original file name”, which should do the trick.

1 Like