Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid no uri index in stream_get_meta_data #412

Closed
wants to merge 2 commits into from

Conversation

bscheshirwork
Copy link
Contributor

@bscheshirwork bscheshirwork commented Apr 7, 2021

fix #411

@GrahamCampbell
Copy link
Member

Can you include a test, please?

@bscheshirwork
Copy link
Contributor Author

so hard to repeat no-url index in separated case (((

I try somthing like

        $thing = <<<TEST
someData
TEST;
        $filename = "php://memory";
        $fp = fopen($filename, "w+b");
        fwrite($fp, $thing);
        rewind($fp);

        $metaData = \stream_get_meta_data($fp);

        $pdo = new \PDO(
            'sqlite::memory:',
            null,
            null,
            [\PDO::ATTR_PERSISTENT => true]
        );
        $pdo->exec("create table `file_storage` ( `data` bytea )");
        $sql = $pdo->prepare("INSERT INTO `file_storage` (`data`) VALUES (:data)");
        $sql->bindValue(':data', $fp, \PDO::PARAM_LOB);
        $sql->execute();

        $stmt = $pdo->query("SELECT * FROM file_storage LIMIT 1");
        $row = $stmt->fetch(\PDO::FETCH_ASSOC);
        $metaData = \stream_get_meta_data($row['data']);

        $response = $this->client->post('etl',
            [
                RequestOptions::MULTIPART => [
                    [
                        'Content-type' => 'multipart/form-data',
                        'name' => 'file',
                        'filename' => 'name',
                        'contents' => $fp,
                    ]
                ],
            ]
        );

but I nave nomore time to try(((

@bscheshirwork
Copy link
Contributor Author

202292e

@GrahamCampbell
Copy link
Member

@Nyholm I'd like to merge this fix on 1.x.

@Nyholm
Copy link
Member

Nyholm commented Apr 8, 2021

Yes. That make sense.

@bscheshirwork could you make a second PR targeting 1.x?

@bscheshirwork bscheshirwork changed the base branch from master to 1.x April 9, 2021 08:26
@bscheshirwork bscheshirwork changed the base branch from 1.x to master April 9, 2021 08:26
@GrahamCampbell
Copy link
Member

Closing in favour of #413. I will branch merge 1.x -> master after the next 1.x release.

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

Successfully merging this pull request may close these issues.

Can't send file from stream_type MEMORY
3 participants