papaerclip file name and special characters

Hi
     I have a problem checking the uniquness of filename. My rails
controller code is

if params[:document]["attachment"] &&
(current_user.documents.find(:all).map(&:attachment_file_name).include?
params[:document]["attachment"].original_filename)
      flash[:error] = "File already exists"
    else
       #store file