'attachment_fu' Tag

  • Jun
    17
    2008

    Attachment_fu sanitize filename, Regex and Unicode gotcha

    Share
    Attachment_fu sanitizes the filenames on uploads to remove any funky character (not 0-9 a-z A-Z, underscore or a period). This is accomplished by the sanitize_filename private method in attachment_fu.rb file

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    def sanitize_filename(filename)
    returning filename.strip do |name|
    # NOTE: File.basename doesn’t work right with Windows paths on Unix
    # get [...]

 
Powered by Wordpress and MySQL. Theme by openark.org