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

Conflict with DIRECTORY_SEPARATOR in S3RenameUpload #16

Closed
jmsalazar84 opened this issue Jan 8, 2014 · 3 comments
Closed

Conflict with DIRECTORY_SEPARATOR in S3RenameUpload #16

jmsalazar84 opened this issue Jan 8, 2014 · 3 comments

Comments

@jmsalazar84
Copy link

Well, i'm using windows and i have some problems when i tried to put an object in my s3 bucket.
For example, i have this file:
/96/40/75/9640759a4b7e2a9aca8ee8f377af0740.png

But in muy bucket, this file its wrong
/96/40/75\9640759a4b7e2a9aca8ee8f377af0740.png

if you add this fix , i think we solve the problem.

protected function getFinalTarget($uploadData)
{
// We cannot upload without a bucket
if (null === $this->options['bucket']) {
throw new MissingBucketException('No bucket was set when trying to upload a file to S3');
}

    $target = parent::getFinalTarget($uploadData);

    // begin fix
    if(DIRECTORY_SEPARATOR != '/'){
        $target = str_replace(DIRECTORY_SEPARATOR, '/', $target);
    }
    // end fix

    return sprintf('s3://%s/%s', $this->options['bucket'], trim($target, '/'));
}
@jeremeamia
Copy link
Contributor

Thanks for letting me know about the problem. Let me know if 99dfe15 works for you.

@jmsalazar84
Copy link
Author

Yeah, it works!

Sorry, but i have a question.
I'm using composer with this rule
"aws/aws-sdk-php-zf2": "1.2.*",

when you think the fix will be available on the repository?

regards ;)

@jeremeamia
Copy link
Contributor

Now! Here is v1.2.1.

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

No branches or pull requests

2 participants