Toggle menu
876
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Attachment class: Difference between revisions

From Catglobe Wiki
No edit summary
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{CGscriptClass_Template
{{CGscriptClass_Template
|Name=Attachment
|Name=<nowiki>Attachment</nowiki>
|Description= Represents an attachment object
|Description=<nowiki>Represents an attachment object.</nowiki>
|Constructors=
|InheritsFrom=object|Constructors=
{{CGscriptConstructors_Template|Parameters=
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=number|Name=resourceId|Description=ResourceId of existing attachment}}
{{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceId</nowiki>|Description=<nowiki>ResourceId of existing attachment.</nowiki>}}
|Description=Fetch existing attachment}}
|Description=<nowiki>Fetch existing attachment.</nowiki>}}
{{CGscriptConstructors_Template|Parameters=
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=string|Name=name|Description=Resource name. If set to empty, the name is taken from the downloaded or copied file}}{{CGscriptParameters_Template|Type=number|Name=parentResourceId|Description=Parent resource}}
{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>ParentResourceId of existing attachment.</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>Name of existing attachment.</nowiki>}}
|Description=Create new attachment}}
|Description=<nowiki>Fetch existing attachment.</nowiki>}}
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>Resource name. If set to empty, the name is taken from the downloaded or copied file.</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Parent resource.</nowiki>}}
|Description=<nowiki>Create new attachment.</nowiki>}}
|Methods=
|Methods=
{{CGscriptMethods_Template|ReturnType=array|Name=GetChildAttachments|Parameters=
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ReadContentAsString</nowiki>|Description=<nowiki>Load the content of the file as a string.</nowiki>}}
{{CGscriptParameters_Template|Type=number|Name=parentResourceId|Description=Parent resource}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SaveFromDownload</nowiki>|Parameters=
|Description=Get all of the attachments associated with the resource}}
{{CGscriptParameters_Template|Type=WebResponse|Name=<nowiki>response</nowiki>|Description=<nowiki>Response from HttpRequest</nowiki>}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=SaveFromDownload|Parameters=
|Description=<nowiki>Download from an HttpRequest's response.</nowiki>}}
{{CGscriptParameters_Template|Type=WebResponse|Name=response|Description=Response from HttpRequest}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SaveFromFileCopy</nowiki>|Parameters=
|Description=Download from an HttpRequest's response}}
{{CGscriptParameters_Template|Type=string|Name=<nowiki>filename</nowiki>|Description=<nowiki>Name of the file</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>isTemp</nowiki>|Description=<nowiki>Is the file temporary</nowiki>}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=SaveFromFileCopy|Parameters=
|Description=<nowiki>Copy from an already stored file using Catglobe.File.</nowiki>}}
{{CGscriptParameters_Template|Type=string|Name=name|Description=Name of the file}}{{CGscriptParameters_Template|Type=bool|Name=isTemp|Description=Is the file temporary}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SaveFromString</nowiki>|Parameters=
|Description=Copy from an already stored file using Catglobe.File}}
{{CGscriptParameters_Template|Type=string|Name=<nowiki>filename</nowiki>|Description=<nowiki>Name of the file</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>content</nowiki>|Description=<nowiki>Content of the file</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}}
|Description=<nowiki>Save from a string.</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
|Properties=
|Properties=
{{CGscriptProperties_Template|ReturnType=number|Name=FileSize|HasGetter=1|Description=The size of the file on disc}}
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>CreatedByUserResourceId</nowiki>|HasGetter=1|Description=<nowiki>Get CreatedByUserResourceId</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=Name|HasGetter=1|HasSetter=1|Description=Resource name. If set to empty, the name is taken from the downloaded or copied file}}
{{CGscriptProperties_Template|ReturnType=DateTime|Name=<nowiki>CreatedDate</nowiki>|HasGetter=1|Description=<nowiki>Get CreatedDate</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object}}
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>FileSize</nowiki>|HasGetter=1|Description=<nowiki>The size of the file on disk</nowiki>}}
{{CGscriptProperties_Template|ReturnType=number|Name=ResourceId|HasGetter=1|Description=The Id of the Attachment}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>InlineImageSrc</nowiki>|HasGetter=1|Description=<nowiki>The uri to use in mails when inlining images</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ModifiedByUserResourceId</nowiki>|HasGetter=1|Description=<nowiki>Get ModifiedByUserResourceId</nowiki>}}
{{CGscriptProperties_Template|ReturnType=DateTime|Name=<nowiki>ModifiedDate</nowiki>|HasGetter=1|Description=<nowiki>Get ModifiedDate</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Name</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Resource name. If set to empty, the name is taken from the downloaded or copied file.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>PublicUrl</nowiki>|HasGetter=1|Description=<nowiki>Url to use to download for anyone</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ResourceId</nowiki>|HasGetter=1|Description=<nowiki>The Id of the Attachment</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
|StaticMethods=
{{CGscriptMethods_Template|ReturnType=Array of Attachment|Name=<nowiki>Attachment_getChildAttachments</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Parent resource.</nowiki>}}
|Description=<nowiki>Get all of the attachments associated with the resource.</nowiki>}}
}}
}}
 
(see more at: [[Attachment_getChildAttachments]])
** NOTE : can't use with mail template, bulk mail

Latest revision as of 06:35, 2 July 2020

Attachment



Represents an attachment object.

Parent class

Inherits from object

Constructors

  • (int resourceId "ResourceId of existing attachment.") - Fetch existing attachment.
  • (int parentResourceId "ParentResourceId of existing attachment.", string name "Name of existing attachment.") - Fetch existing attachment.
  • (string name "Resource name. If set to empty, the name is taken from the downloaded or copied file.", int parentResourceId "Parent resource.") - Create new attachment.

Methods

  • string ReadContentAsString() - Load the content of the file as a string.
  • Empty SaveFromDownload(WebResponse response "Response from HttpRequest") - Download from an HttpRequest's response.
  • Empty SaveFromFileCopy(string filename "Name of the file", bool isTemp "Is the file temporary") - Copy from an already stored file using Catglobe.File.
  • Empty SaveFromString(string filename "Name of the file", string content "Content of the file") - Save from a string.
  • (From object) string ToString() - The string representation of the object.

Properties

  • int CreatedByUserResourceId { get; } - Get CreatedByUserResourceId
  • DateTime CreatedDate { get; } - Get CreatedDate
  • int FileSize { get; } - The size of the file on disk
  • string InlineImageSrc { get; } - The uri to use in mails when inlining images
  • int ModifiedByUserResourceId { get; } - Get ModifiedByUserResourceId
  • DateTime ModifiedDate { get; } - Get ModifiedDate
  • string Name { get; set; } - Resource name. If set to empty, the name is taken from the downloaded or copied file.
  • string ObjectTypeName { get; } - The name of the type of object.
  • string PublicUrl { get; } - Url to use to download for anyone
  • int ResourceId { get; } - The Id of the Attachment
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.

Static Methods

  • Array of Attachment Attachment_getChildAttachments(int parentResourceId "Parent resource.") - Get all of the attachments associated with the resource.

(see more at: Attachment_getChildAttachments)