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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:15:58+00:00 2026-05-21T17:15:58+00:00

must be some thing simply resolving, but as a beginner, i’ve already spend 2

  • 0

must be some thing simply resolving, but as a beginner, i’ve already spend 2 days trying to find out. I’m having a simple form (“enctype=”multipart/form-data”) with few inputs of text and file. I can’t get what’s wrong, i can get user’s text data through getParameter(), but cannot get file getFiles(). i’m on ubuntu 11.04 php5.3

code:

form class:

public function configure()
  {
    $this->setWidgets(array(
      'vendor'  => new sfWidgetFormInputText(array(), array('class' => 'form-text')),
      'image'       => new sfWidgetFormInputFile(array(), array('class' => 'form-text')),
      'city'      => new sfWidgetFormInputText(),
      'email'   => new sfWidgetFormInputText(array('default' => 'simple@sample.org')),
        'contacts' => new sfWidgetFormTextarea(),
      'description' => new sfWidgetFormTextarea(),
    ));
    $this->setValidators(array(
      'vendor'  => new sfValidatorString(array('required' => false)),
        'image'   => new sfValidatorFile(array(
            'required'  => false,
        'path'       => sfConfig::get('sf_upload_dir') . '/images',
        'mime_types' => 'web_images')),
      'city'    => new sfValidatorString(array('required' => false)),
        'email' => new sfValidatorString(array('required' => false)),
        'contacts'  => new sfValidatorString(array('required' => false)),
        'description'   => new sfValidatorString(array('required' => false)),
    ));
    $this->widgetSchema->setNameFormat('pv[%s]');
  }

action:

public function executeCreate(sfWebRequest $request)
{
$this->forward404Unless($request->isMethod(sfRequest::POST));
return $this->renderText(var_dump($request->getParameter('pv'))); //this array include vars from form
//return $this->renderText(var_dump($request->getFiles('pv'))); //empty array
}
  • 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-21T17:15:59+00:00Added an answer on May 21, 2026 at 5:15 pm

    You should provide the actual code you are trying with. You could also look further into the forms component, which has a section on file uploads with example code here (bottom of page):

    http://www.symfony-project.org/forms/1_2/en/02-Form-Validation

    This part of the docs is still relevant for symfony 1.4.

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

Sidebar

Related Questions

I find this very strange, must be something I'm doing wrong, but still... I'm
Some of the features I think it must include are: Print Entire Solution Ability
Obviously I can do and DateTime.Now.After - DateTime.Now.Before but there must be something more
I know I must be missing something, but in a while statement how does
I'm sure I must be doing something wrong. But can't for the life of
I'm having a weird issue with a function I'm trying to call from within
I am struggling with very simple thing: I receive some ids by http request
I must be overlooking something simple. I'm setting a variable from a query result
I think there must be something subtle going on here that I don't know
I know websphere does it, so there must be something that lets apache figure

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.