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

  • SEARCH
  • Home
  • 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 7657637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:04:46+00:00 2026-05-31T13:04:46+00:00

I have an Image uploading application running on carrierwave which restrict user from uploading

  • 0

I have an Image uploading application running on carrierwave which restrict user from uploading image only of desired extensions ‘jpg,jpeg,png’ I have put in place the validation for carrierwave in my Uploader define as

def extension_white_list
  %w(jpg jpeg png)
end

Now anyone trying to upload image having extension different from the desired extension(mention above) will result in validation errors

I want to customize the Validation Error message

Right Now Error message is presented as

You are not allowed to upload "" files, allowed types: ["jpg","jpeg","png"]

Can anyone help I found this link where the guys mention how to achieve this

but it some problem

1. I18n support I dont require to translate the error message using I18n 

2. The 'Key' to be used I not sure which key to used in YAML for
    not matching extension whitelist error message (e.g) carrierwave_processing_error key if error is for processing failure

Please Provide me answer in term of CarrierWave and please dont ask me to write separate validation set for extension matching

  • 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-31T13:04:47+00:00Added an answer on May 31, 2026 at 1:04 pm

    Add this to your .yml translation file:

    en:
      errors:
        messages:
          extension_white_list_error: "You are not allowed to upload %{extension} files, allowed types: %{allowed_types}"
          content_type_whitelist_error: "You are not allowed to upload %{content_type} files, allowed types: %{allowed_types}"
    

    Source:

    https://github.com/jnicklas/carrierwave/blob/master/lib/carrierwave/locale/en.yml

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

Sidebar

Related Questions

I have an image uploading script in which i use the following setup to
I have an application which has the requirement, but infrequent usage, of uploading an
I have developed an image uploading application that uses Flash to load an image,
I have a flex application in which I have to convert a jpeg picture
In one of my web application I have to show the image which selected
I am uploading a user image in mvc2 web application. User can upload an
I am developing an android application, in which I have to upload image to
In my web application I have an image uploading module. I want to check
I have an ASPX page where I am uploading an image to server for
I have created a WCF service for uploading images , which accepts System.IO.Stream as

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.