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 8301305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:53:25+00:00 2026-06-08T16:53:25+00:00

In my application I have a file upload (actually multiple file uploads), and I

  • 0

In my application I have a file upload (actually multiple file uploads), and I managed to do it without using a gem/plugin like (Ex: carrierware).

But when my form validation fails it loads the from data with error messages, but not the values in file_fields. My client wants to keep the values as it is when form validation fails.

I have search a bit and found out that for security reasons, its not allowed to set values to file fields. So can someone proposed me a possible workaround for this (to keep the selected file path when a form validation fails)

Please note that I’m not using Ajax form post here, this is simple default HTTP post

I’m running on ruby 1.9.2 and rails 3.0.0

thanks in advance

  • 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-06-08T16:53:27+00:00Added an answer on June 8, 2026 at 4:53 pm

    It is not possible to do with what you are asking. Due to security reasons, the value of the upload field can not be set, or even styled with some browsers.

    The best bet:

    • Upload the file before the validation, then discard if the user cancels.
    • Use ajax, or a fancy form of uploading. (Store path in hidden field, and then upload with some form of ajax/flash.)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Actually I'm creating an application for uploading file using JSF. But whenever I upload
I have a file upload application. I want to test my Upload controller. For
I have a Rails application that accepts file uploads of CSV files. When developing
I have one desktop application which was implemented in C#. This app uploads file
We have a file manager-like application where we use the action bar home button
I have a Web Application in which I am using asp:FileUpload Control to upload
I have a file upload function in my asp.net mvc application that allows users
Is there some open source file upload (application) solution for a scenario like this?
I am currently using the Zend Framework and have an upload file form. An
I am trying to upload video from the iPhone application using FBConnect. Actually I

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.