V
V
Vadim Solovyov2016-08-21 13:48:31
Design
Vadim Solovyov, 2016-08-21 13:48:31

How to find out if there are Cyrillic characters in the file name?

0dc94a112da24e34bf39415d02c05eb7.png
Some sites swear at the presence of Cyrillic characters in the file name, is it possible to somehow detect them even before downloading?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
X
xmoonlight, 2016-08-21
@xmoonlight

This is bad practice.
Instead, do this:
1. When saving - name the image container (picture) using a base64 string or ordinal hexadecimal character representation (ID-HEX as String).
2. Real name - write to the database along with the full path to the container.

V
Vitaly Inchin ☢, 2016-08-21
@In4in

First, you can rename files on upload.
Secondly, if this does not suit the situation, then you can check the name of the uploaded file with a regular expression: for example ^[0-9\-_A-z]+$.
To be honest, I didn't really understand the question. Who should upload files and where? And at what stage should they be checked?

D
Dimonchik, 2016-08-21
@dimonchik2013

sites complain about the presence of incomprehensible symbols in general, and not Cyrillic ones,
is solved by requesting fix non ANSI symbols for your language / tool

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question