Answer the question
In order to leave comments, you need to log in
Bitrix: Can't save detailed image?
array
Array
(
[name] => 628992_v01_b.jpg
[size] => 22575
[tmp_name] => /tmp/merlion_goods/628992_v01_b.jpg
[type] => image/jpeg
)
CIBlockElement::SetPropertyValueCode($found_id, "DETAIL_PICTURE", $array['DETAIL_PICTURE']);
CIBlockElement::SetPropertyValues($found_id, $item['IBLOCK_ID'],$array['DETAIL_PICTURE'] , 'DETAIL_PICTURE');
$el->Update($found_id, ['DETAIL_PICTURE'=>$array['DETAIL_PICTURE'], 'PREVIEW_PICTURE'=>$array['DETAIL_PICTURE']]);
CIBlockElement::SetPropertyValues($found_id, $item['IBLOCK_ID'], $array['PROPERTY_VALUES']['MORE_PHOTO'], 'MORE_PHOTO');
Answer the question
In order to leave comments, you need to log in
SetPropertyValues changes the value of a property. DETAIL_PICTURE is a field, in bitrix terminology.
So you have only one correct option:
But what do you have in $array['DETAIL_PICTURE']?
In general, the jamb was found by enumeration of the kernel. It turned out that the wrong character was not in the file name, but in section_code - there were hyphens instead of underscores. But why the error pointed to the picture I do not know. renamed the product and everything was OK
thanks to Bitrix for so much sex.
Today I ran into a similar problem.
Swears: "File name not specified" when adding announcement and detail images.
At the same time, the files are saved in the properties.
In my case, there were products with the same name in the category. The solution is to give a character code. He doesn’t swear at hyphens, but I really liked the sex.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question