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

How to upload image to Etsy #541

Open
CoolColdUK opened this issue May 28, 2018 · 1 comment
Open

How to upload image to Etsy #541

CoolColdUK opened this issue May 28, 2018 · 1 comment

Comments

@CoolColdUK
Copy link

I am using PHP 7 and laravel framework and CURL on phpoauthlib. The '@file_path' as suggested by etsy has been depreciated. I have tried to use the following
$param['image']= new \CURLFile($image_path, mime_content_type($image_path), 'image.jpg');

I will get the error "rawurlencode() expects parameter 1 to be string, object given" in signature.php. I believe it tries to combine all parameter into single string.

If I am to use the following
$param['image'] = base64_encode(file_get_contents($image_path));

I would get the error from Etsy saying "the request body is too large"

Is there any way I can upload or use curlfile at the moment? Will I be able to upload using steam instead?

Thanks in advance.

@CoolColdUK
Copy link
Author

Hi again.

Got mine working using StreamContext following this method
https://stackoverflow.com/a/4247082

Not elegant but did the job.

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

1 participant