I have some PDF and video files those I want to upload and detect the language of those from the uploaded contents or file names using Paperclip and Ruby on Rails app on the Linux server.
I'm using s3 storage for uploading files with Paperclip as below
class UserFile < ActiveRecord::Base
has_attached_file :file, storage: :s3, s3_credentials: cred, bucket: bucket, path: "#{Rails.env}/#{`hostname`}/"
end
I'm using the Paperclip to upload the files, how can I detect the language or localization or the region of the files from which it is getting uploaded.
I want to discriminate folders to save those files based on language on the server.
So basically I just want to detect the uploaded file locations and language and save that to respected folders.