Skip to main content
added 8 characters in body
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90

In the old COM API's TCMScriptAssistant class, which has it's methods exposed to VBScript templates, there is an AddBinary method which I think you are looking for...

Documentation is as follows:

AddBinary

Summary

Writes binary data from a Multimedia Component to a temporary directory so that the publisher can retrieve the file and publish it to the Content Distributor at the location specified by the Structure Group.

Usage

Use this function to publish a Binary file and obtain its URL.

Visual Basic Syntax

Public Function AddBinary(
    ByVal component As Variant,
    ByVal structureGroup As Variant,
    Optional ByVal variantId As String = ""
) As String

Parameters

component: A Multimedia Component or URI of a Multimedia Component of which the BinaryContent is retrieved.
structureGroup: A Structure Group or URI of a Structure Group that defines the directory to which the binary will be published.

Remarks

Publishing fails if a file exists in the specified location that has the same name as the file you attempt to publish, and that is not an earlier published version of this Multimedia Component.

Return value

Returns the (UTF-8) URL of the Binary file. In a UTF-8 URL, characters are first encoded in UTF-8 encoding and then standard URL encoding is applied. For example: the character µ µ (Unicode: 0x00B50x00B5) is first encoded in UTF-8 as two bytes: 0xC20xC2 and 0xB50xB5. After URL encoding this becomes: "%C2%B5"%C2%B5.

Example

[% 
... 
Dim lStrFilename 

lStrFilename = AddBinary(lObjMultimediaComponent, lObjStructureGroup) 

'Use Filename to create image tag 
WriteOut "<img src=" & lstrfilename & " width=100 height=100>" 
%]

In the old COM API's TCMScriptAssistant class, which has it's methods exposed to VBScript templates, there is an AddBinary method which I think you are looking for...

Documentation is as follows:

AddBinary

Summary

Writes binary data from a Multimedia Component to a temporary directory so that the publisher can retrieve the file and publish it to the Content Distributor at the location specified by the Structure Group.

Usage

Use this function to publish a Binary file and obtain its URL.

Visual Basic Syntax

Public Function AddBinary(
    ByVal component As Variant,
    ByVal structureGroup As Variant,
    Optional ByVal variantId As String = ""
) As String

Parameters

component: A Multimedia Component or URI of a Multimedia Component of which the BinaryContent is retrieved.
structureGroup: A Structure Group or URI of a Structure Group that defines the directory to which the binary will be published.

Remarks

Publishing fails if a file exists in the specified location that has the same name as the file you attempt to publish, and that is not an earlier published version of this Multimedia Component.

Return value

Returns the (UTF-8) URL of the Binary file. In a UTF-8 URL, characters are first encoded in UTF-8 encoding and then standard URL encoding is applied. For example: the character µ (Unicode: 0x00B5) is first encoded in UTF-8 as two bytes: 0xC2 and 0xB5. After URL encoding this becomes: "%C2%B5".

Example

[% 
... 
Dim lStrFilename 

lStrFilename = AddBinary(lObjMultimediaComponent, lObjStructureGroup) 

'Use Filename to create image tag 
WriteOut "<img src=" & lstrfilename & " width=100 height=100>" 
%]

In the old COM API's TCMScriptAssistant class, which has it's methods exposed to VBScript templates, there is an AddBinary method which I think you are looking for...

Documentation is as follows:

AddBinary

Summary

Writes binary data from a Multimedia Component to a temporary directory so that the publisher can retrieve the file and publish it to the Content Distributor at the location specified by the Structure Group.

Usage

Use this function to publish a Binary file and obtain its URL.

Visual Basic Syntax

Public Function AddBinary(
    ByVal component As Variant,
    ByVal structureGroup As Variant,
    Optional ByVal variantId As String = ""
) As String

Parameters

component: A Multimedia Component or URI of a Multimedia Component of which the BinaryContent is retrieved.
structureGroup: A Structure Group or URI of a Structure Group that defines the directory to which the binary will be published.

Remarks

Publishing fails if a file exists in the specified location that has the same name as the file you attempt to publish, and that is not an earlier published version of this Multimedia Component.

Return value

Returns the (UTF-8) URL of the Binary file. In a UTF-8 URL, characters are first encoded in UTF-8 encoding and then standard URL encoding is applied. For example: the character µ (Unicode: 0x00B5) is first encoded in UTF-8 as two bytes: 0xC2 and 0xB5. After URL encoding this becomes: %C2%B5.

Example

[% 
... 
Dim lStrFilename 

lStrFilename = AddBinary(lObjMultimediaComponent, lObjStructureGroup) 

'Use Filename to create image tag 
WriteOut "<img src=" & lstrfilename & " width=100 height=100>" 
%]
Source Link
David Forster
  • 8k
  • 2
  • 16
  • 29

In the old COM API's TCMScriptAssistant class, which has it's methods exposed to VBScript templates, there is an AddBinary method which I think you are looking for...

Documentation is as follows:

AddBinary

Summary

Writes binary data from a Multimedia Component to a temporary directory so that the publisher can retrieve the file and publish it to the Content Distributor at the location specified by the Structure Group.

Usage

Use this function to publish a Binary file and obtain its URL.

Visual Basic Syntax

Public Function AddBinary(
    ByVal component As Variant,
    ByVal structureGroup As Variant,
    Optional ByVal variantId As String = ""
) As String

Parameters

component: A Multimedia Component or URI of a Multimedia Component of which the BinaryContent is retrieved.
structureGroup: A Structure Group or URI of a Structure Group that defines the directory to which the binary will be published.

Remarks

Publishing fails if a file exists in the specified location that has the same name as the file you attempt to publish, and that is not an earlier published version of this Multimedia Component.

Return value

Returns the (UTF-8) URL of the Binary file. In a UTF-8 URL, characters are first encoded in UTF-8 encoding and then standard URL encoding is applied. For example: the character µ (Unicode: 0x00B5) is first encoded in UTF-8 as two bytes: 0xC2 and 0xB5. After URL encoding this becomes: "%C2%B5".

Example

[% 
... 
Dim lStrFilename 

lStrFilename = AddBinary(lObjMultimediaComponent, lObjStructureGroup) 

'Use Filename to create image tag 
WriteOut "<img src=" & lstrfilename & " width=100 height=100>" 
%]