Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Zend\Filter\File\RenameUpload issues #5241

@ghost

Description

Zend\Filter\File\RenameUpload is not working as excepted right now (as far as I remember it worked on zf 2.2)

Right now, when I add RenameUpload filter in fieldset:

'filters' => array(
array(
'name' => 'FileRenameUpload',
'options' => array(
'target' => $path,
'randomize' => true,
'use_upload_name' => true
))),

its leading to errors after submiting form!

stack trace:
http://pastebin.com/ZxhaGdvp

After my debugging I noticed that after I manually use isValid() method on form, FileRenameUpload filter is moving file from /tmp/hash123asd to target directory, and after that isValid() is called again which leads to calling move_uploaded_file one more time. 2nd call to move_uploaded_file got source file argument equals to target (not /tmp/hash123asd) and exception is raised.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions