BinaryData

Methods:

Size
Write

Constructors:

Based on file

Description:

The value contains binary data read from the file. The value can be saved in ValueStorage.
Stored data can be written to a file.

Availability:

Thin client, web-client, server, thick client, external connection, Mobile application (client), Mobile application (server).
Serializable. The given object may be serialized to/from XML. Can be used in attributes of managed form. The given object may be serialized to/from XDTO. The XDTO type correspoding to this object is defined in {http://www.w3.org/2001/XMLSchema} namespace. XDTO type name: May be either of the following: base64Binary, hexBinary.

Example:

MyPicture = New BinaryData("C:\MyDocuments\Picture1.bmp");
PictureStorage = New ValueStorage(MyPicture);

// Save value of ValueStorage type to the database
NewNomenclature = Catalogs.Nomenclature.CreateItem();
NewNomenclature.Name = "Divan ""Margarita""";
// Image attribute has the ValueStirage type
NewNomenclature.Image = PictureStorage;
NewNomenclature.Write();
...
// Load value of BinaryData type form value storage to a file
FileName = "C:\MyDocuments\Picture2.bmp";
NewNomenclature.Image.Get().Write(FileName);

See also:

MailAttachment, property Data
MailAttachments, method Add
InternetMailAttachments, method Add
Picture, method GetBinaryData
Global context, method Base64Value
Global context, method Base64String
Picture, constructor Generating from binary data
InternetMailText, property Data
FastInfosetReader, method SetBinaryData

    

1C:Enterprise Developer's Community