PrestaSharp
PrestaSharp copied to clipboard
I cannot upload or add products images.
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
Hello @kulunkadeco Is it possible to enable display php errors in PrestaShop Cloud? Regards.
@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);
}
}
Web service was authorized?
@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
Hımmm, yes, now i saw exception
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 :)
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?
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.