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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:25:32+00:00 2026-05-26T21:25:32+00:00

I am writing a web application using CakePHP. Now with cake after a save

  • 0

I am writing a web application using CakePHP. Now with cake after a save has failed and is redirected back to an add or edit screen the data that was inserted is back in the form fields for the user to edit. This is exactly how I want it, the problem is the file upload field is not kept. Is there a way to retain the path for the file input form field when a user has selected an image to upload?

Thanks

  • 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-26T21:25:33+00:00Added an answer on May 26, 2026 at 9:25 pm

    Modern browsers will obfuscate the value of a file input to hide information about the client’s filesystem. This includes accessing the input value through javascript, where browsers will return something like C:\fakepath\file.txt.

    Setting the value of file inputs is also generally not allowed, either by setting the value attribute in HTML, or through javascript. So, you would not be able to restore the previous value of the input field even if you could somehow find out what it was. Try for yourself here:

    http://jsfiddle.net/MP39Q/2/

    (There are some exceptions to some of these restrictions, e.g. earlier versions of IE, but I imagine this doesn’t help you.)

    Since the user’s path is not sent as part of the form data, it will not be available in PHP.

    A solution in your case may be to keep the uploaded file on the server. When a save error occurs, pass an appropriate reference to the temporary file back to the form (e.g. through session data), and allow the user to choose whether to keep the original file, or select a new one to upload while they correct other parts of the form.

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

Sidebar

Related Questions

I am writing one web application using PHP/CodeIginter. Now, I want to add a
I'm writing a simple web application using CakePHP version 1.2 (the latest) and am
I'm writing a web application using Spring/Hibernate that displays a report to a user,
I am writing a web application using PHP. I want to use the MVC
I'm writing a web application using the Catalyst framework . I'm also using a
I'm writing a web application that decodes Morse Code that is tapped in using
I am writing a web application which retrieves a lot of data using AJAX
I am writing a web server application in C# and using StreamReader class to
I'm writing an .NET 3.5 web application that is using LinqToSql for the basic
I am writing web application using ASP.NET MVC + NHibernate + Postres stack. 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.