We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38483
    • 29 Posts
    Sorry, i don't understand last message. :-(
      • 40844
      • 6 Posts
      1. Столкнулся с той же проблемой на виртуальном linux-сервере под nginx.
      На локалхосте под апачем все работало отлично, а тут первые слова названий файлов пропадают.
      Поэтому подозреваю, что проблема не в самом аддоне.

      2. Загружал файлы с фронта через elFinder. На сервер попадают в UTF-8, как и при загрузке через manager.
      А вот при загрузке по ftp названия файлов остаются в win-1251 [ed. note: shadowspan last edited this post 14 years, 2 months ago.]
        • 11055 ☆ A M B ☆
        • 3,112 Posts
        I just can't test this for Cyrillics, sorry.
        My computer system is not set up for it.
          Rico
          Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
          MODx is great, but knowing how to use it well makes it perfect!

          www.virtudraft.com

          Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

          Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

          Maintainter/contributor of Babel

          Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
          • 40844
          • 6 Posts
          goldsky

          It's okay.
          I checked on a different host, addon works correctly. So the problem is not in FileDownload

          Only in IE and only in pop-up downloading window, name of the file remained in the wrong encoding.
          Corrected this file modification \core\components\filedownload\models\filedownload\filedownload.class.php
          Line 669:
          header ('Content-Disposition: attachment; filename = "'. basename ($ filePath). '"');

          replaced by
          header ('Content-Disposition: attachment; filename = "'. basename (iconv ('utf-8', 'windows-1251', $ filePath)). '"');

          Now at this hosting everything is working correctly. At the other will try understand the nginx settings

          Thank you for the useful addon smiley
            • 11055 ☆ A M B ☆
            • 3,112 Posts
            ahhh..
            excelent!

            i'll bookmark this! laugh

            thx for reporting back.
              Rico
              Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
              MODx is great, but knowing how to use it well makes it perfect!

              www.virtudraft.com

              Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

              Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

              Maintainter/contributor of Babel

              Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
              • 40844
              • 6 Posts
              Проблема оказалась в установках локали.

              Самое простое решение для кириллицы - в начале того же файла
              \core\components\filedownload\models\filedownload\filedownload.class.php

              добавить строку
              setlocale(LC_CTYPE, 'ru_RU.UTF-8'); [ed. note: shadowspan last edited this post 14 years, 2 months ago.]
                • 38483
                • 29 Posts
                Quote from: shadowspan at Aug 21, 2012, 05:22 AM
                Проблема оказалась в установках локали.
                Самое простое решение для кириллицы
                Спасибо! Молодец! Теперь модуль стал более актуальным.
                  • 40844
                  • 6 Posts
                  alexandr rs

                  К сожалению этого оказалось недостаточно. Отображаются файлы верно, но на одном из двух хостингов загружаются все еще без первого слова в названии. Но хоть уже понятнее куда копать, сперва в ступоре был.

                  Еще есть предположение что стоит обновить версию php. [ed. note: shadowspan last edited this post 14 years, 2 months ago.]
                    • 40844
                    • 6 Posts
                    Решил у себя обходом функции basename, похоже это из-за ее конфликтов с локалью пропадают первые слова.

                    все в том же файле заменил строки содержащие basename на:

                    $baseName = substr( strrchr( $fileRealPath, "/"), 1);


                    и

                    header('Content-Disposition: attachment; filename="' . substr( strrchr( (iconv('utf-8' , 'windows-1251' , $filePath)), "/"), 1) . '"');


                    На обоих хостах где тестил полет нормальный.
                      • 38483
                      • 29 Posts
                      Quote from: shadowspan at Aug 21, 2012, 11:39 AM
                      Решил у себя обходом функции basename, похоже это из-за ее конфликтов с локалью пропадают первые слова.
                      На обоих хостах где тестил полет нормальный.
                      Хм... А мне не потребовалось этого. Достаточно "setlocal"