I uploaded the file to Google Drive, but I got an error during the download:
ActionController::MissingFile: Cannot read file original_22_Wages372-817339(wages).pdf
I think he had no way to google.
Attachment Model:
has_attached_file :doc, storage: :google_drive, google_drive_credentials: "#{Rails.root}/config/google_drive.yml", google_drive_options: { public_folder_id: '0BwCp_aK6VhiaQmh5TG9Qbm0zcDQ', path: proc { |style| "#{style}_#{id}_#{doc.original_filename}" } }
Controller:
attachment = Attachment.find(params[:id]) send_file attachment.doc.path(:original), filename: attachment.doc_file_name, type: attachment.doc_content_type, stream: 'true', x_sendfile: true
Thanks in advance
source share