[ZF2 2.0.0rc3] FileTransfer breaks when uploading "*.gif" files?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ZF2 2.0.0rc3] FileTransfer breaks when uploading "*.gif" files?

cmple
This post has NOT been accepted by the mailing list yet.
Hi,

When uploading an animated .gif image using FileTransfer, some necessary file data is missing (e.g.  [tmp_name] => NULL)

Here is my class (simplified version):

<?php

namespace Application\Service\File;

use Zend\File\Transfer\Adapter\Http as FileTransfer,
        Zend\Filter\File\Rename as FileRename;

class Upload extends FileTransfer {
       
       
        private $uploadBaseDir;
        private $uploadDir;
       
        public function __construct() {
                parent::__construct();
        }
       
        public function upload() {
       
                $this->setDestination($this->uploadBaseDir . '/' . $this->uploadDir);
                $this->setOptions(array('useByteString' => false));

                $files = $this->getFileInfo();

                echo "<pre>";
                print_r($files);
                exit;
        }
}

When uploading a .jpeg image, the data looks fine:
Array
(
    [filename] => Array
        (
            [name] => my_file.jpg
            [type] => image/jpeg
            [tmp_name] => /private/var/tmp/phpOzEU0y
            [error] => 0
            [size] => 86923
            [options] => Array
                (
                    [ignoreNoFile] =>
                    [useByteString] =>
                    [magicFile] =>
                    [detectInfos] => 1
                )

            [validated] =>
            [received] =>
            [filtered] =>
            [validators] => Array
                (
                    [0] => Zend\Validator\File\Upload
                )

            [destination] => /***/public/files/cmple_c5a3
        )

)


But when I try to upload an animated .gif, some data is missing:

Array
(
    [filename] => Array
        (
            [name] => my_animated_file.gif
            [type] => 
            [tmp_name] => 
            [error] => 1
            [size] =>
            [options] => Array
                (
                    [ignoreNoFile] =>
                    [useByteString] =>
                    [magicFile] =>
                    [detectInfos] => 1
                )

            [validated] =>
            [received] =>
            [filtered] =>
            [validators] => Array
                (
                    [0] => Zend\Validator\File\Upload
                )

            [destination] => /***/public/files/cmple_c5a3
        )

)

I've tried this with numerous different files from the net, getting the same results.

Am I missing something?

Thanks!!
Roman.