element-desktop icon indicating copy to clipboard operation
element-desktop copied to clipboard

When saving a file, use unique name if file exists already

Open Athwale opened this issue 1 year ago • 3 comments

Your use case

What would you like to do?

When saving a file and a file already exists with the same name, make the save dialog use a new unique filename.

Why would you like to do it?

Currently when saving images for example some file types are always saved as image.xxx which causes a problem when saving more than one. Each subsequent file has to be manually renamed.

How would you like to achieve it?

With something as simple as: if image.png exists the saving dialog will give the new file the name image1.png...

Have you considered any alternatives?

There are none.

Additional context

No response

Athwale avatar Oct 26 '23 11:10 Athwale

We don't control the save dialog, it is the default one from Chromium/Electron

t3chguy avatar Oct 26 '23 11:10 t3chguy

You can not check in your code before the dialog is opened and send the filename into the dialog as a parameter?

Athwale avatar Oct 26 '23 13:10 Athwale

We don't open the dialog, it is opened when the Chromium inside Electron signals for a save dialog due to a link being clicked. We could rewire everything to fire these dialogs manually but it'd be a huge refactoring to the matrix-react-sdk and element-web

t3chguy avatar Oct 26 '23 13:10 t3chguy