Constructors
Attachment()
Methods
dump()
Dumps the attachment file to output.Use dump(Bool) to signal the browser to download the file instead of display it.
dump(Bool)
Dumps the attachment file to output. The optional parameter if true tells the browser to download the file, and not attempt to display it.getBase64()
Returns the attachment as base64 encoded string.This can be used to load a binary attachment into a string, as base64 coded data is valid ASCII.
getDownloadUrl(Bool,Bool)
Constructs a download URL for the attachment.There are 2 kinds of URLs: external = used by customers; internal = used by Service users.
getRaw()
Gets the whole attachment as a String without any special encoding.getValue(String)
Gets a value from the attachment class.The current implementation supports the following values as the name parameter.
- id: the attachment ID
- contentType: content descriptor
- name: the filename
- size: size in bytes
- key: authentication key
- charset
- dbiAgentId
- dbiKey
- dbiLastModified
- dbiLastSyncronized
load(Integer)
Loads a Service attachment from disk.remove()
Deletes the attachment record from the database and the attachment file from disk.save()
Saves the attachment to disk.saveBase64(String)
Creates a filename and saves a base64-coded attachment to disk.setValue(String,String)
Sets a value on the attachment object.The current implementation supports the following values as the name parameter.
- id: the attachment ID
- contentType: content descriptor
- name: the filename
- size: size in bytes
- key: authentication key
- charset
- dbiAgentId
- dbiKey
- dbiLastModified
- dbiLastSyncronized