Jump to content
dummzeuch

"M.A1R.SigBrightness_2020-03-25" The filename is invalid.

Recommended Posts

I just got a very odd error message from a TJvSaveDialog:

M.A1R.SigBrightness_2020-03-25
The filename is not valid.

As you can see in the screenshot, there are already several files with the same name scheme in that directory:

 

invalid-filename.thumb.png.b58ff714c05a6aa8b52a228ba9054773.png

 

The dialog seems to come from the Windows Dialog itself, at least the call stack doesn't show any JVCL or RTL code after the call to Execute.

 

I admit that the file name is a bit unconventional, but it should still be valid. If I save the file as e.g. 'bla.dat' I can later on simply rename it to the name I originally intended. Also, if the file already exists and I simply select it, I get an overwrite prompt and then can save the file. To be sure that there are'nt any invisible characters there, I type the whole thing. The error occurs anyway. I also tried different directories, on the server and on a local drive, even in the root of drive d:. No difference.

 

WTF is going on here?

Share this post


Link to post

OK, found it: The problem was not the file name but the filter (Save as type): If I change it to *.* it works.

Seems that Windows for whatever reason doesn't like the filter to contain a * at the end of the extension (in my case "*.SigBrightness*". If I switch to the filter "*.SigBrightness" (without the trailing *), Windows appends ".SigBrightness" to the file name, which I can then manually remove and save the file with the intended name.

 

Now, how do I get Windows to show the selection I want but still let me save the file?

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×