Answer the question
In order to leave comments, you need to log in
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));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question