Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor_Toc523144951_Toc523144951Canvas APIs for Managing Profile Pictures
Anchor_Toc507680980_Toc507680980Now you can call the APIs listed in this section as per your requirements to manage profile pictures in the applications built using Canvas framework. Note:

Info

For your understanding, sample application screen shots from jQM have been provided in this section.

Before calling the APIs, set the following properties in the componentpreferences.properties file:

  1. Specify the path of the user upload images for your application.

Image Removed

  1. Specify the maximum size for the user image file in bytes.

Image Removed

  1. Specify the image formats, which can be uploaded by the user.

...

  • Image source (argument 1): This is a mandatory argument. You must provide the data source in the base64 format or the URL format.
  • Target ID to set the data source (argument 2): This is an optional argument. The image element data-item-id value is given as the argument.If you want the picture to display in the default picture placeholder (element ID) provided by Canvas, use 'ct-pic' as the argument. If you want the profile picture to be displayed anywhere else in your application, you must provide the unique value of your application's element ID (for example, myprofile-pic) in your template as the argument.

...

  1. Code Block
    languagebash
    ###########################################################################################
    # This property is used to define the path of the user uploaded images.
    # This should be a relative path with respect to the
    # root path that is configured as CT_WORK_CENTRALIZED_PATH in implementation property file.
    ###########################################################################################
    USER_IMAGES_FOLDER=/PictureUpload 


  2. Specify the maximum size for the user image file in bytes.

    Code Block
    languagebash
    ######################################################################
    # This Property is used to restrict the user uploaded images file size
    ######################################################################
    USER_IMAGES_MAXSIZE=10485760


  3. Specify the image formats, which can be uploaded by the user.

    Code Block
    languagebash
    ##############################################################################
    # This property will define the user images formats which uploaded by the user.
    ##############################################################################
    USER_IMAGE_FORMATS=jpg,png,gif,jpeg


Info

If you want the images to be in a particular dimension, specify the dimension for the image element (<img>) in your CSS.

Refer the following pages:

Page Tree
rootProfile Picture APIs