File renaming in viewer (web client)

Sorry for deleting the form, it’s a general issue/question.
(NC AIO latest on Ubuntu 24.04 LTS)

I miss the ability to rename a file directly from the viewer (for PDFs, photos, videos, text). I constantly have to switch back to the file manager, which sometimes involves remembering and searching for cryptic filenames.

In my opinion, it would make a lot of sense to integrate a “Rename” function into the details sidebar. This would enable the feature for all file types at once. It could work either “in-place” or be placed in the … dropdown menu, where currently only options like “Tags” and “Favorites” are located.

Or am I doing something wrong? I’m somewhat surprised that such a fundamental feature is missing in what is otherwise a mature product.

Does it make sense to submit a feature request?

I’m not all that surprised. I mean, how many PDF viewers, or other applications for that matter, can you name that allow you to rename an open file in place? With PDF viewers that have editing functions, you can save the PDF as a new file with a new name. However, renaming an open file is definitely not a common feature in any applications, not just in PDF viewers.

Furthermore, in most operating systems, the file handle is “locked” by the application, so not even the OS typically allows renaming until the file is closed. To be honest, I’m not sure if this would be possible without significant workarounds.

Ok, true, you’re right, I complained too quickly.

Still, it would be convenient. In NC access is done via fileid anyway, so renaming a file is always possible for users, provided they have permission. To my surprise, NC allows different names for shared files for different users.

In the meantime, I’ve put together (with ChatGPT’s help) a bookmarklet that does the job and is fine for me (JavaScript popup for renaming in the opened view – I often take data from the document into the filename)

Anyway – thanks.

I marked this as answer for a workaround.

For a feature, you could probably do a rename after closing the file.

With the file lock, normally no other users should modify the file, once the data is loaded to the viewer, I don’t know if that is doable to move the file in the background without reloading the viewer. For photos and other things, you’d probably rather do a live-tagging of viewed items. If the renaming is really a thing many people need and a killer feature, then someone might open a feature request and others should give their thumbs up. If it is for you a one-time thing and a workaround is good enough, …

Not really. My wish is to set the file name while viewing the PDF document, based on the currently visible data (not editing) – i.e. not after the file has been closed (I know about tags).
This is possible. The viewer obviously caches the file. The new name only becomes visible after a refresh (that probably applies to other file viewers as well). At the operating system level, everything runs under a single user anyway – AFAIK.

But I can live with my workaround, not just as a one-time quick help.

Anyway – thanks

I just remeber from my Windows days, that it was usually not possible to rename a file while it was open. On my current Linux setup, though, I can rename PDFs in GNOME Files even while they’re open. However the new name isn’t reflected in the PDF viewer app until the file is reopened, so I’m not sure if renaming directly from the app would really be feasible. At least, I don’t know of any app that supports this, which might be for good reasons. :wink:

That said, why not open a feature request on GitHub and see what the developers think? It probably won’t get implemented tomorrow, or maybe not at all, but it doesn’t hurt to ask, I guess. :slight_smile:

Thank you for your attention, but you misunderstood me. I don’t want to change the filenames on the operating system level (like with GNOME Files), bypassing NC. I want to rename them within NC env. Maybe it was misleading in my first request to speak of a “file manager” — what I meant was the Files app in NC.

No, I didn’t misunderstand it. I just used it as an example to illustrate how it behaves on the desktop when you rename a PDF file while it’s open in a desktop app. And guess what? It’s exactly the same on Nextcloud when it’s open in the PDF viewer in your browser.

You can actually rename a PDF in the NC Files app while it is open in the PDF viewer. I just tested it…

Simply open the PDF viewer and the NC Files app in separate browser tabs or windows. Nextcloud then behaves exactly as it would on the desktop: you can rename the file in the NC files app while it’s open in the PDF viewer in the other tab. However, the new name won’t be reflected in the viewer until you refresh the page, which reloads the PDF viewer and the file.

So yes, I suppose in theory it would be possible to integrate a file renaming feature into the sidebar which is part of the Nextcloud core, not actually the PDF viewer itself. However, you would probably still have to reload the file for the name change to be reflected in the PDF viewer. Also, I’m not sure how it would behave with other filetypes, like Office files, which might be locked while open.

But again, If you would like to see this feature, open a feature request on GitHub, and see what the devs think…