Difference between revisions of "Attachment class"

From Catglobe Wiki
Jump to: navigation, search
Line 5: Line 5:
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceId</nowiki>|Description=<nowiki>ResourceId of existing attachment.</nowiki>}}
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceId</nowiki>|Description=<nowiki>ResourceId of existing attachment.</nowiki>}}
 +
|Description=<nowiki>Fetch existing attachment.</nowiki>}}
 +
{{CGscriptConstructors_Template|Parameters=
 +
{{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=<nowiki>Fetch existing attachment.</nowiki>}}
 
|Description=<nowiki>Fetch existing attachment.</nowiki>}}
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
Line 13: Line 16:
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Parent resource.</nowiki>}}
 
{{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>}}
 
|Description=<nowiki>Get all of the attachments associated with the resource.</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ReadContentAsString</nowiki>|Description=<nowiki>Load the content of the file as a string.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SaveFromDownload</nowiki>|Parameters=
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SaveFromDownload</nowiki>|Parameters=
 
{{CGscriptParameters_Template|Type=WebResponse|Name=<nowiki>response</nowiki>|Description=<nowiki>Response from HttpRequest</nowiki>}}
 
{{CGscriptParameters_Template|Type=WebResponse|Name=<nowiki>response</nowiki>|Description=<nowiki>Response from HttpRequest</nowiki>}}
Line 19: Line 23:
 
{{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>}}
 
{{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>}}
 
|Description=<nowiki>Copy from an already stored file using Catglobe.File.</nowiki>}}
 
|Description=<nowiki>Copy from an already stored file using Catglobe.File.</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SaveFromString</nowiki>|Parameters=
 +
{{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>}}
 +
|Description=<nowiki>Save from a string.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
 
|Properties=
 
|Properties=

Revision as of 10:42, 5 December 2017

Attachment



Represents an attachment 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

  • Array of objects GetChildAttachments(int parentResourceId "Parent resource.") - Get all of the attachments associated with the resource.
  • 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.
  • 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
  • TypeInformation TypeInformation { get; } - Get information about this class.