Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6566161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:11:01+00:00 2026-05-25T14:11:01+00:00

I am using paperclip for attachments when i download file, it got corrupted. File

  • 0

I am using paperclip for attachments

when i download file, it got corrupted.

File is download-able at production

send_file attachment.data.path, :type => attachment.content_type, :x_sendfile => true, :stream => false

it is working fine at local machine but it gives problem in production however i have set env as production

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:11:02+00:00Added an answer on May 25, 2026 at 2:11 pm

    The first thing to do is to check what is the file you are trying to send.

    Add this line of code before your send_file statement:

    logger.info "SENDING FILE: #{attachment.data.path.inspect}"
    

    Then see the log, check the path and see whether the file really is there.

    I suspect that your production and development modes have different database data (and this is natural and expected), but the files saved in the filesystem are not in synchronization with the databases.

    It is possible that there is some other difference between environments, but the path is the first thing I would consider guilty.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Excuse me I am using paperclip. so when i attachment a file diferent to
I was using paperclip for file upload. with validations as below: validates_attachment_content_type :upload, :content_type=>['application/pdf'],
I'm using paperclip to upload a pdf. Once the file is uploaded I need
I'm trying to upload an MP3 file (using the paperclip plugin) and then read
I'm using paperclip for attachments in my application. I'm writing an import script for
I'm using Ruby 1.9 and Rails 2.3.4 with Paperclip gem to save attachments. and
I built a photo gallery which uses Paperclip and validates the content-type using validates_attachment_content_type.
I'm using Paperclip / S3 for file uploading. I upload text-like files (not .txt,
I have a Profile model, which has attached file picture, using Paperclip. I am
I am using Rails to make a small file upload app. For file attachment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.