windowsunixfilenames

How to get a file in Windows with a colon in the filename?


I am getting errors from customers who are uploading files with a colon in the file name, i.e. C:/uploads/test : doc.html

I assume that some Unix or Linux system is generating the file but I'm not sure how the users are saving them with the invalid filename. I have coded a piece that should rename the document on upload. My problem is that I can't test it because I can't get a file on Windows that has a colon in the filename.


Solution

  • I found a very similar character to a colon, "꞉" it is a unicode character called a Modifier Letter Colon. This has no space like the fullwidth colon and is pretty much exactly the same as a regular colon but the symbol works. You can either copy and paste it from above or you can use the code point, U+A789

    Update: Windows 11 interprets this character as a question mark, so this approach will not work. "Warning: New file name not allowed in Windows (contains '?')"