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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:25:12+00:00 2026-06-07T15:25:12+00:00

I have a product form that users can upload 5 pictures simultaneously. Everything is

  • 0

I have a product form that users can upload 5 pictures simultaneously. Everything is working fine with that but I’m trying to implement the sfThumbnail plugin so that it creates a thumbnail of each of the pictures at the same time. The code below works for Picture1 but Picture2, 3, 4, and 5 it doesn’t. I’ve tried messing with the code and I can’t get it to work with each file individually. It just takes the uploaded file for Picture2 for example and it names it the same as picture 1. So when it runs through I end up with 5 uploaded pictures, but only 1 thumbnail with the filename of the first picture.

I tried to duplicate the code 5 times and customize it for each of the pictures but I got the same result.

If there’s a more efficient way of doing this please show me. This is just what I got from the plugin documentation. Thanks

if($this->isModified())
    {
      $uploadDir = sfConfig::get('sf_upload_dir');
      $thumbnail = new sfThumbnail(150, 150);
      $thumbnail->loadFile($uploadDir.'/car/'.$this->getPicture1());
      $thumbnail->save($uploadDir.'/car/thumbnail/'. $this->getPicture1());
    }
  • 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-07T15:25:14+00:00Added an answer on June 7, 2026 at 3:25 pm

    This is what worked for me:

    if($this->isModified())
        {
          $uploadDir = sfConfig::get('sf_upload_dir');
          $thumbnail = new sfThumbnail(150, 150);
          if($this->getPicture1())
          {
            $thumbnail->loadFile($uploadDir.'/car/'.$this->getPicture1());
            $thumbnail->save($uploadDir.'/car/thumbnail/'. $this->getPicture1());
          }
    
          if($this->getPicture2())
          {
            $thumbnail->loadFile($uploadDir.'/car/'.$this->getPicture2());
            $thumbnail->save($uploadDir.'/car/thumbnail/'. $this->getPicture2());
          }
    
    .. the rest of my the pictures
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a digital asset management product where users can upload images
I had another form to upload the details of 1 product which have multiple
I have a form where users can specify various parameters to dig through some
I have a form on my site where users can submit text as part
I have this form which allows the input of any product quantity from 1-10:
I have a search form where user can search for products within their specified
I have a field 'Description' which can have product descriptions with any unicode characters.
I am working on a online shopping website, it will have product images also.
I have a product in mind that requires the development of a website that
I have a modified admin form, where I added a field that shall modify

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.