M
M
Maxim Grechushnikov2014-11-06 15:48:53
1C-Bitrix
Maxim Grechushnikov, 2014-11-06 15:48:53

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
        )

$found_id = element number in the system
Did it like this
CIBlockElement::SetPropertyValueCode($found_id, "DETAIL_PICTURE", $array['DETAIL_PICTURE']);

and like this
CIBlockElement::SetPropertyValues($found_id, $item['IBLOCK_ID'],$array['DETAIL_PICTURE'] , 'DETAIL_PICTURE');

and even so
$el->Update($found_id, ['DETAIL_PICTURE'=>$array['DETAIL_PICTURE'], 'PREVIEW_PICTURE'=>$array['DETAIL_PICTURE']]);

Detailed picture is not set.
BUT nearby, in the code a little higher, the code is completely fulfilled
CIBlockElement::SetPropertyValues($found_id, $item['IBLOCK_ID'], $array['PROPERTY_VALUES']['MORE_PHOTO'], 'MORE_PHOTO');

CHADNT?
upd:
I honestly looked for where it is configured in the admin panel. Have not found
X_O6867nTts.jpg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2014-11-06
@maxyc_webber

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']?

M
Maxim Grechushnikov, 2014-11-07
@maxyc_webber

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.

B
Beeshop87, 2022-02-15
@Beeshop87

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 question

Ask a Question

731 491 924 answers to any question