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

[BUG] regression after #13, cannot find file using filename #19

Open
buse974 opened this issue Feb 24, 2016 · 8 comments
Open

[BUG] regression after #13, cannot find file using filename #19

buse974 opened this issue Feb 24, 2016 · 8 comments
Assignees
Labels

Comments

@buse974
Copy link
Contributor

buse974 commented Feb 24, 2016

Hello,
Since the merge #13 , the param $files of the method receive($files = null) does not work.

In my example code the file MyFile.txt is not moved.

$adp = new Http();
            $adp->setDestination($mydest);
            $adp->receive("MyFile.txt");

In method getFiles the name MyFile.txt is never found (here) because
since the merge #13 was added "MyFile.txt" file name is rename in "phpackXwt_MyFile.txt".

@yourithielen
Copy link

I can confirm this issue, the file upload is broken.

@codisart
Copy link
Contributor

codisart commented Apr 6, 2016

Hi,

I am the author of the #13 PR.
As I noted in the comments of the pull request, the goal is to correct the behaviour of Zend_File when multiple files are uploaded with the same name in the same form as they would be moved to the same filepath and only one would be present at the end. (In some cases, if the destination folder is the same for all uploads in the app, the problem will also be present even for several upload from different users, it could be a security issue, see #22)

But in the case you are presenting, the problem is not my code.

$adp = new Http();
            $adp->setDestination($mydest);
            $adp->receive("MyFile.txt");

If I'm not mistaking, the argument of the receive method should not be the uploaded file name but the html input name.

$adp = new Http();
            $adp->setDestination($mydest);
            $adp->receive("input_name");

@codisart
Copy link
Contributor

codisart commented Apr 7, 2016

And I am mistaking !

So I just reread the code behind the receive method and in fact, it should find a file by its name.
I may be onto a fix for this issue, but I don't know what this method should be returning if they are several files with the same name in the request.

Do any one have a suggestion ?

@codisart
Copy link
Contributor

codisart commented May 3, 2016

Hi everyone,

I'd really like to know what you think about this problem.
@weierophinney since you merged the original PR, maybe you got an idea ?

@sobelfallcayor
Copy link

Hi, i had this problem bat solved it to make :
$adapter->receive() for all files
or
$adapter->receive('one_file_name_input_html') if there is one file on sumission.

@froschdesign
Copy link
Member

@localheinz
Can you look at this?

@localheinz
Copy link
Member

Will do!

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-file; a new issue has been opened at laminas/laminas-file#1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants