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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:54:16+00:00 2026-05-24T15:54:16+00:00

Cant seem to find my problem, but what I am trying to do is

  • 0

Cant seem to find my problem, but what I am trying to do is have a edit form for project groups, which can have 4 images.
When I try to upload all four of the images, it works, when I upload only 1, it doesn’t.

Code: HTML form

<?php
    $langs = $this->langs;
    $projectGroup = $this->projectGroup;
?>
<div id="box">
    <h3>Edit Project Group</h3>
    <form id = "form" name = "form" action="<?php echo URLgenerator::getURL('project', 'group-edit', array('id' => $projectGroup->getId()), 'admin'); ?>" method="post" enctype='multipart/form-data'>
        <?php 
            foreach($langs as $lang):
                $langId = $lang->getId();
                $displayName = $lang->getDisplayName();
        ?>
            <fieldset id="In<?php echo $displayName; ?>">
                <legend id ="<?php echo $langId?>">
                    <?php echo $displayName; ?>: 
                </legend> 
                <label for="name-<?php echo $langId; ?>">Name: </label> 
                <input type="text" id="name-<?php echo $langId; ?>" name="name-<?php echo $langId; ?>" style="width: 500px;" value="<?php echo $projectGroup->getName($lang); ?>" />
                <br />
                <label for="imageOff-<?php echo $langId; ?>">Image Off: </label> 
                <input type="file" id="imageOff-<?php echo $langId; ?>" name="imageOff-<?php echo $langId; ?>" />
                <img src="<?php echo $projectGroup->getImageOffURL($lang); ?>" />
                <br />
                <label for="imageOn-<?php echo $langId; ?>">Image On: </label> 
                <input type="file" id="imageOn-<?php echo $langId; ?>" name="imageOn-<?php echo $langId; ?>" />
                <img src="<?php echo $projectGroup->getImageOnURL($lang); ?>" />
            </fieldset>
        <?php 
            endforeach;
        ?>
        <div align="center">
            <input type="submit" value="Edit" id="button1" /> 
            <input type="reset" id="button2" />
        </div>
    </form>
</div>

<script type="text/javascript">
    <?php 
        foreach($langs as $lang):
            $langId = $lang->getId();
    ?>
    $('#<?php echo $langId; ?>').click(function() {
        $('#div-<?php echo $langId; ?>').toggle();
    });
    <?php 
        endforeach;
    ?>
</script>

Code: edit action

public function groupEditAction()
{
    $id = $this->getRequest()->getParam('id');
    $projectGroup = new ProjectGroup($id);

    $name = Array();
    $langs = LangFuncs::getAllLangs();
    foreach($langs as $lang) {
        $langId = $lang->getId();

        $name[$langId] = $this->getRequest()->getParam("name-$langId");
    }

    $projectGroup->edit(null, $name);

    $upload = new Zend_File_Transfer_Adapter_Http();
    $upload->setDestination(URLgenerator::getTempFolder());
    $upload->receive();
    $info = $upload->getFileInfo();
    var_dump($info);
    return;
    foreach($langs as $lang) {
        $langId = $lang->getId();
        try { 
            if($info["imageOff-$langId"]['tmp_name'] != '') {
                $projectGroup->uploadImageOff($lang, $info["imageOff-$langId"]['tmp_name']);
                unlink($info["imageOff-$langId"]['tmp_name']);
            }
            if($info["imageOn-$langId"]['tmp_name'] != '') {
                $projectGroup->uploadImageOn($lang, $info["imageOn-$langId"]['tmp_name']);
                unlink($info["imageOn-$langId"]['tmp_name']);
            }
        } 
        catch (Zend_File_Transfer_Exception $e) { 
            $this->_helper->redirector('image-upload', 'error', 'admin', array());
        }
    } 

    $this->_helper->redirector('index', 'project', 'admin', array());
}

And what I get when I do the var_dump:

array
  'imageOff-1' => 
    array
      'name' => string '1.gif' (length=5)
      'type' => string 'application/octet-stream' (length=24)
      'tmp_name' => string 'C:\wamp\tmp\php95C1.tmp' (length=23)
      'error' => int 0
      'size' => string '2248' (length=4)
      'options' => 
        array
          'ignoreNoFile' => boolean false
          'useByteString' => boolean true
          'magicFile' => null
          'detectInfos' => boolean true
      'validated' => boolean true
      'received' => boolean false
      'filtered' => boolean false
      'validators' => 
        array
          0 => string 'Zend_Validate_File_Upload' (length=25)
      'destination' => string 'C:/wamp/www/EfCom/public/tmp' (length=28)
  'imageOn-1' => 
    array
      'name' => string '' (length=0)
      'type' => null
      'tmp_name' => string '' (length=0)
      'error' => int 4
      'size' => null
      'options' => 
        array
          'ignoreNoFile' => boolean false
          'useByteString' => boolean true
          'magicFile' => null
          'detectInfos' => boolean true
      'validated' => boolean false
      'received' => boolean false
      'filtered' => boolean false
      'validators' => 
        array
          0 => string 'Zend_Validate_File_Upload' (length=25)
      'destination' => string 'C:/wamp/www/EfCom/public/tmp' (length=28)
  'imageOff-2' => 
    array
      'name' => string '' (length=0)
      'type' => null
      'tmp_name' => string '' (length=0)
      'error' => int 4
      'size' => null
      'options' => 
        array
          'ignoreNoFile' => boolean false
          'useByteString' => boolean true
          'magicFile' => null
          'detectInfos' => boolean true
      'validated' => boolean false
      'received' => boolean false
      'filtered' => boolean false
      'validators' => 
        array
          0 => string 'Zend_Validate_File_Upload' (length=25)
      'destination' => string 'C:/wamp/www/EfCom/public/tmp' (length=28)
  'imageOn-2' => 
    array
      'name' => string '' (length=0)
      'type' => null
      'tmp_name' => string '' (length=0)
      'error' => int 4
      'size' => null
      'options' => 
        array
          'ignoreNoFile' => boolean false
          'useByteString' => boolean true
          'magicFile' => null
          'detectInfos' => boolean true
      'validated' => boolean false
      'received' => boolean false
      'filtered' => boolean false
      'validators' => 
        array
          0 => string 'Zend_Validate_File_Upload' (length=25)
      'destination' => string 'C:/wamp/www/EfCom/public/tmp' (length=28)

PS.
Maybe I can make it work by taking this temp name and working with it, but in a normal situation I get that the temp name has a normal extension and not a .tmp, so I work with that as the extension. When I get the .tmp, I don’t do anything because it is not a .jpg, .png or a .gif (in my upload function).

If you need the upload function too, comment please.

  • 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-24T15:54:17+00:00Added an answer on May 24, 2026 at 3:54 pm

    You may need to set ignoreNoFile to be true. Take a look at this post to see if it helps: Zend_File_Transfer w/multiple files does not upload equally

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

Sidebar

Related Questions

I have a problem which I cant seem to find answer to through searches
I have a problem which i can't seem to find the solution to. I
Looks like others have had this problem but I can't seem to find a
The problem seems simple, but I can't seem to find a way to implement
I'm a newbie to C#, but can't seem to find anything about this problem.
I have been trying to work out the bug on this but can't seem
I'm trying to figure something out, but can't seem to find the reason why,
It seems like this is a common problem, but I can't seem to find
I have a very similar problem, but i cant seem to figure it out,
I can't seem to find solutions to this supposedly simple problem /bug, so here

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.