using rails with Paperclip, I can use the following to get the filename during a before_create:
extension = File.extname(photo_file_name).downcase
How do I get JUST the file name.. Right now I have photo_file_name which provides the entire file, titlename.pdf
i need just titlename without the .pdf
Thanks
Updating with code:
photo.rb:
before_create :obfuscate_file_name
#Paperclip for photo
has_attached_file :photo,
......
private
def obfuscate_file_name
extension = File.extname(photo_file_name).downcase
fileNameOnly = File.basename(photo_file_name).downcase
self.photo.instance_write(:file_name, "#{fileNameOnly}_#{ActiveSupport::SecureRandom.hex(32)}#{extension}")
end