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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:36:12+00:00 2026-05-25T06:36:12+00:00

I have in Symfony 1.4 form: $this->setWidget(‘title’, new sfWidgetFormInputText()); $this->setWidget(‘photo’, new sfWidgetFormInputFile()); if i

  • 0

I have in Symfony 1.4 form:

$this->setWidget('title', new sfWidgetFormInputText());
$this->setWidget('photo', new sfWidgetFormInputFile());

if i send this form, and he is valid then show me page with error. In input TITLE is previous text, which i entered, but no link to attach files. I must again search this file and select. How can i fix it?

  • 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-25T06:36:13+00:00Added an answer on May 25, 2026 at 6:36 am

    In short, you can’t. This is a symptom of HTML file inputs.

    A file input takes a the local path of the file on the client’s machine (not the server), so consider this (hypothetical) scenario:

    1. User A uploads a file and saves article
    2. User B edits the article, and the file input is pre-populated with the path to the file that was uploaded by User A (but the path doesn’t exist on User B’s machine).
    3. User B saves, and no file is submitted.

    It would be a major security risk also. Let’s say you write a malicious script which contains a form and file input. If you knew the path to a file on the client’s machine then you could pre-populate the file input and then submit the form with JavaScript to force the user to upload the file.

    This is why you can’t pre-populate a file input in HTML.

    As an alternative you should use sfWidgetFormInputFileEditable which will display the previously uploaded image alongside the file input. However, this will only display once the form has submitted and saved successfully.

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

Sidebar

Related Questions

I am new to symfony. I have created a registration form using the code:
I have a symfony form which have created_at and updated_at field for date. But
A quick question. I have a symfony form. When I save the form, I
A question about symfony form validators. For example I have an url field. If
i have the following schema and i want to create a Form with Symfony
I am using Symfony 1.2.9, and I have a form that contains two date
I have a form created with Symfony forms. and in the template i have
Using symfony 1.4. I have the following widget declaration in my form: 'region' =>
I've got a form class with a checkbox widget: $this->setWidgets(array( 'status' => new sfWidgetFormInputCheckbox(array('value_attribute_value'
I have a symfony form and i need to add a couple of fields(widgets)

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.