We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7479
    • 1 Posts
    Hi,
    I was wondering if there is a configuration setting that i missed or a possible workaround for uploading files with special characters in the filename. For example, I can use the file manager to upload a file called "_`!@34#$%^&()_+~.doc" however when i try to delete it I get an error:
    Deleting file `C:/www/modx/_`!@34`: C:/www/modx/_`!@34Failed!
    It appears that the code is truncating the filename somehow. I was experimenting with modifying the code using urlencode and htmlspecialchars but was unsuccessful. Does anyone have any suggestions on a fix? Other than renaming the files of course grin
    Thanks in advance.
    Dinko
      • 7231
      • 4,205 Posts
      I don’t think that is a MODx limitation, the special characters cause problems with PHP (and other languages as well) since they are often used for special functions. Try deleting directly with an FTP client, but you may still run into problems. Good idea to avoid special chars in file names.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Your domain’s control panel should be able to deal with it.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 10449
          • 956 Posts
          Well, if you wanted to change the file-upload behaviour, you’d have to edit manager/actions/files.dynamic.php somewhere after line 160... e.g. insert some regex / str_replace renaming functions.
          Do a backup first smiley