Answer the question
In order to leave comments, you need to log in
How to upload photo in xml?
In general, the task is to upload a photo of an object in xml format.
Condition given:
A set of links to images of a property, each of which is enclosed in an image tag.
If the attribute primary="1" is set for the image, then it is considered the main one.
Link to the image of the property on your site. Type: string.
Format: www.site.ru/image.jpg
Supported image formats: jpg, gif, png....
The code I wrote
//photo
$db_props = CIBlockElement::GetProperty("18", $arFields["ID"], array("sort" => "asc"), array("CODE"=>"MORE_PHOTO"));
$razd = "";
$photo = "";
while($ar_props = $db_props->Fetch())
{
$rsFile = CFile::GetByID($ar_props["VALUE"]);
$arFile = $rsFile->Fetch();
$arImagesPath = CFile::GetPath($ar_props["VALUE"]);
$domainname = "www***.ru";
//$photo = $photo.$razd.$arFile["FILE_NAME"];
$photo = $photo.$razd.$domainname.$arImagesPath;
//print_r($domainname.$arImagesPath);print_r(" ");
$razd = ", ";
//$arrImages[$arElement["ID"]][] = $arFile;
//print_r($ar_props);
}
$fieldsToExport[$i]["images"] = $photo;
<photo>
www.***.ru/upload/iblock/f78/cqm yrtlx-2.jpg, www.***.ru/upload/iblock/3c8/01_big.jpg, www.***.ru/upload/iblock/b78/IMG_3286_big.jpg,
</photo>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question