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

I cannot upload or add products images. #118

Closed
kulunkadeco opened this issue Jan 29, 2015 · 8 comments
Closed

I cannot upload or add products images. #118

kulunkadeco opened this issue Jan 29, 2015 · 8 comments
Assignees
Labels

Comments

@kulunkadeco
Copy link

Hello everybody,

First of all, thank you for this usefull library.

I'm working with Prestashop Cloud and I have found a problem I'm not able to solve.
I can get products, Manufacturers and so on without problem. But I cannot upload or add products images.

Here is the code where I upload or add a new image:

ImageFactory myFactory = new ImageFactory(BaseUrl, Account, Password);
string image = @"D:\test1.jpg";

myFactory.AddProductImage(1, image);
myFactory.UpdateProductImage(1, 1, image);

error {"\r\nCC8N5UKFD62I4VDLPSMUXQNUWS5DVYPG\r\n\r\nBasic Q0M4TjVVS0ZENjJJNFZETFBTTVVYUU5VV1M1RFZZUEc6\r\n\r\napplication/json, application/xml, text/json, text/x-json, text/javascript, text/xml\r\n\r\n HttpStatusCode: InternalServerError"}

Thanks in advance

@EduLeonPavon
Copy link
Member

Hello @kulunkadeco
Is it possible to enable display php errors in PrestaShop Cloud?
Regards.

@meron1122
Copy link

@EduLeonPavon
Exception thrown: 'Bukimedia.PrestaSharp.PrestaSharpException' in Bukimedia.PrestaSharp.dll

Additional information:

full

HGMSBST9J6XRV9J2RQ7CAWDF459GZQ7I

Basic SEdNU0JTVDlKNlhSVjlKMlJRN0NBV0RGNDU5R1pRN0kgIDo=

text/xml

HttpStatusCode: InternalServerError

Code:

                var ImagesList = this.ImageFactory.GetProductImages((long)ProductPresta.id);
                //remove old images
                if (ImagesList.Count != 0)
                {
                    foreach (var Image in ImagesList)
                    {
                        this.ImageFactory.DeleteProductImage((long)ProductPresta.id, Image.id);
                    }
                }

@n3xpect
Copy link

n3xpect commented Aug 17, 2015

Web service was authorized?

@meron1122
Copy link

@mcaykara
Yep, everything expect this works fine, This Product have no image, I expect empty enumerator, no Exception from PrestaShop.
Btw associations.images always is empty

@n3xpect
Copy link

n3xpect commented Aug 17, 2015

Hımmm, yes, now i saw exception

@N0is3
Copy link

N0is3 commented Apr 20, 2016

Hi, news about this bug?
I'm in the same condition when i use

ImageFactory images = new ImageFactory(BaseUrl, Account, Password);
var ImageList = images.GetProductImages((long)product.id);

Thank you anyway for this great work :)

@JM63
Copy link

JM63 commented Nov 14, 2016

Hi, news about this?
I'm having the same problem.

ImageFactory images = new ImageFactory(BaseUrl, Account, Password);
var ImageList = images.GetProductImages((long)product.id);

How can i solve this?

@ifiora
Copy link

ifiora commented Feb 26, 2018

I was able to work around it by checking the id_default_image property.
If its null I assume it has no Image associated to it, so I can make the query for product Images on the Image Factory.

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

No branches or pull requests

8 participants