Image.createFromData (Method)

Create a base64 representation of an image and assigns it the attributes contained within this method's arguments.

Returns:

ImageID (integer)

Arguments:

Name Type Required Description
subsiteIDOrURL SubsiteIDorURL_EmptyString Required The ID of the target subsite, or the server relative path to the target subsite, or an empty string for the current subsite.
fileName ImageFileName Required The image's filename.
title PlainText_255 Optional. Defaults to an empty string. The image's title.
encodedImageData Base64Data Required Base 64 encoded image data.
categoryID ImageCategoryID Required The ID of the image category.
description PlainText_NonNull_255 Required The image's description.
galleryID ImageGalleryID Optional. Defaults to '2'. ID of the image gallery in which to add the image.
metadata MetadataValueArray Optional. Defaults to '#ArrayNew(1)#'. An array of MetadataValue structures that describe the metadata for the image, or an empty array if no metadata is specified.

Context:

License Requirements None
Permission Requirements subsite:UploadImages
Deny Context None
Require Context AuthoringEnabled
Author Lock  

Error Codes:

Code Error Message
1000406 Insufficient permissions exist for uploading the specified file type.
1000407 $1

Notes:

None