G
G
Gregory Didus2017-01-25 04:22:20
MODX
Gregory Didus, 2017-01-25 04:22:20

MODX Revo, Cyrillic and spaces in filenames. How to decide?

Hello!
CMF: MODX Revo 2.4.3
I do synchronization of goods between stores.
I have done it many times, but for the first time I encountered this problem.
What I did:
1. I wrote a script for dragging photos from one site to another, all photos were successfully copied.
2. I wrote a script for creating products based on the upload file, everything works fine except for images.
The essence of the problem:
Some images contain Cyrillic characters and spaces in the title, they are not displayed on the site.
I've been trying to solve the problem for several hours, it doesn't work.
Googled a lot, applied iconv, urlencode, rawurlencode, str_replace - nothing helps.
Solution examples:

// имя файла
$str1 = '.Импреза (12)-big-1100x1649-c4ae.jpg';

// вариант решения - не работает
$str2 = rawurlencode(iconv("cp-1251", "utf-8", $str1));


// вариант решения 2 - не работает
$str2 = urlencode(iconv("cp-1251", "utf-8", $str1));

Question:
Any ideas how to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zooks, 2017-01-25
@zooks

Pack them with tar and unzip them on the server, then the Cyrillic alphabet will work (the names will not be broken).
Next, warn content managers not to use Russian names in file names in the future.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question