imageprompt
imageprompt
Prompts the user for an image to be uploaded. It returns a cloudobject representing the new image
the app will automatically process the image into three resolutions: the original, a "mid size" image, and a "thumbnail" image.
The cloudobject created will be of a special type called "storedCloudImage",
whose "url", "midsize_url" and "thumbnail_url" will be the URLs associated with the full size, mid size and thumbnail sized images.
If the user selects "cancel" then imageprompt will return FALSE.
If imageprompt encounters an error, then it will return FALSE, an alert will be shown
describing the error and the global variable
"upload_error" will be set to the string describing the error.
The Prompt may vary
The actual prompt displayed on the user's screen may vary depending on the type of device. On some mobile devices, a button may appear that, when clicked, will give the user options for using existing images stored on the mobile device, or to take a new photo using the camera.
Uploaded image data will be stored in the database
Despite the fact the there are URLs for the stored images, the actual uploaded image data will be stored int he application database, and will be removed form the database if the storedCloudImage is deleted using the delete() function.
Format:
image = imageprompt()
Parameters:
This function does not take any parameters.
Returned Value:
| Type | Description |
|---|---|
| cloudobject | the storedCloudImage created (or FALSE if cancelled or upload failed) |
Examples
profile_image = imageprompt()
if (upload_error) {
alert(upload_error)
}