Configures the uploading of local images to your application using Textbox.io's built in upload mechanism.
This property can be configured to either:
- Upload Images using a form POST
To use Textbox.io's built-in upload mechanism, use
|String||Defines the location of your POST acceptor script. This is the URL to which images will be uploaded.|
|String||[Optional] Defines the base path of images uploaded in your application. This path is combined with the path returned from your POST acceptor script.|
upload.handler. Note that defining
upload.handler disables Textbox.io's built in upload mechanism.
Using Textbox.io's Built-in Upload Mechanism
configurationobject is used to define the upload location for images.
basePathis used in conjunction with the value returned by the POST handler to link to the uploaded image within the editor's content. More information is available in the Handling Local Images guide.
If images must be uploaded using more than a simple HTTP POST, the entire upload process can be replaced. For example, you may wish to perform additional client side validation or manipulation on the images prior to their upload. The handler function is passed three arguments; Data (object), Success (function) and Failure (function).
Data Object Properties
The first argument is an object providing information about the image that has been inserted. All properties are functions.
A copy of the image binary data pre-converted to base64 for your convenience
|String||The actual filename, where possible, otherwise a generated filename based on the MIME type|
|String||A unique identifier for this image|
Success Function Parameters
The second argument is a function that indicates the upload has successfully completed
The URL to use as the image src. No post-processing is performed on this value (the
Failure Function Parameters
The third argument is a function that indicates the upload failed.
A message to display to the user in an error banner.
This value is optional - if you do not wish to translate your error a generic message is available which has been translated into all supported languages.