fileprompt

fileprompt Prompts the user for a file to be uploaded. It returns a cloudobject representing the new file. The cloudobject created will be of a special type called "storedCloudFile", with the following properties:

Property Description
urlThe URL associated with the file.
original_filenameThe file's original file name (with extension)
last_modified_timeUnix time stamp of the last modified time for the file.
sizeSize of the file in bytes.
extensionThe file's extension (e.g. "pdf")
mime_typeThe MIME type string for the file (e.g. "application/pdf")


If the user selects "cancel" then fileprompt will return FALSE. If fileprompt 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.

Format:

file_object = fileprompt()

Parameters:

This function does not take any parameters.

Returned Value:

Type Description
cloudobject The storedCloudFile created (or FALSE if cancelled or upload failed)

Examples

 document = fileprompt()
 if (upload_error) {
    alert(upload_error)
 }