- Upload Suite Overview
- What's New?
- Choosing Upload Technology
- Evaluating Upload Suite
- Upload Suite Editions
- System Requirements
- Installation and Deployment Notes
- ActiveX/Java Uploader
- HTML5/Flash Uploader
- Before You Started with HTML5/Flash Uploader
- HTML5/Flash Uploader Architecture
- HTML5/Flash Uploader User Interface
- Getting Started
- Using HTML5/Flash Uploader
- Troubleshooting
- Reference
- HTML5/Flash Uploader ASP.NET Reference
- HTML5/Flash Uploader PHP Reference
- HTML5/Flash Uploader JavaScript Reference
- $au Namespace HTML5/Flash Uploader JavaScript
- addFilesProgressDialog Class HTML5/Flash Uploader JavaScript
- commonDialog Class HTML5/Flash Uploader JavaScript
- converter Class HTML5/Flash Uploader JavaScript
- converters Class HTML5/Flash Uploader JavaScript
- debug Class HTML5/Flash Uploader JavaScript
- descriptionEditor Class HTML5/Flash Uploader JavaScript
- drawTool Class HTML5/Flash Uploader JavaScript
- event Class HTML5/Flash Uploader JavaScript
- events Class HTML5/Flash Uploader JavaScript
- file Class HTML5/Flash Uploader JavaScript
- file Members HTML5/Flash Uploader JavaScript
- file Methods HTML5/Flash Uploader JavaScript
- calculateHash(Function) Method HTML5/Flash Uploader JavaScript
- exif(Function) Method HTML5/Flash Uploader JavaScript
- getPreview(Object) Method HTML5/Flash Uploader JavaScript
- iptc(Function) Method HTML5/Flash Uploader JavaScript
- remove Method HTML5/Flash Uploader JavaScript
- showImageEditor(Number,Number) Method HTML5/Flash Uploader JavaScript
- file Properties HTML5/Flash Uploader JavaScript
- files Class HTML5/Flash Uploader JavaScript
- flashControl Class HTML5/Flash Uploader JavaScript
- imageEditor Class HTML5/Flash Uploader JavaScript
- imagePreviewWindow Class HTML5/Flash Uploader JavaScript
- imageUploaderFlash Class HTML5/Flash Uploader JavaScript
- informationBar Class HTML5/Flash Uploader JavaScript
- messages Class HTML5/Flash Uploader JavaScript
- metadata Class HTML5/Flash Uploader JavaScript
- paneItem Class HTML5/Flash Uploader JavaScript
- restrictions Class HTML5/Flash Uploader JavaScript
- statusPane Class HTML5/Flash Uploader JavaScript
- topPane Class HTML5/Flash Uploader JavaScript
- uploadErrorDialog Class HTML5/Flash Uploader JavaScript
- uploadPane Class HTML5/Flash Uploader JavaScript
- uploadSettings Class HTML5/Flash Uploader JavaScript
- $au.amazonS3Extender Namespace HTML5/Flash Uploader JavaScript
- $au Namespace HTML5/Flash Uploader JavaScript
- HTML5/Flash Uploader Client-Side Events Reference
- POST Field Reference
- Licensing Information
- Legal Notices
file.getPreview(Object) Method HTML5/Flash Uploader JavaScript
Receives an img element of containing the preview of a file.
Syntax
$au.imageUploaderFlash('uploaderID').files().get(index).getPreview(previewParams);
Parameters
- previewParams
-
Type: Object
The object containing three properties -
callback(function with animgargument),sizeof the preview you need to return andmodeto specify how to interpret the size (whether to fit into the square of this size or automatically crop the preview). The latter param accepts the values of thumbnailFitMode.
Remarks
This function is asyncronous. You pass a previewParams instance which contains a callback. When the preview image is ready, the callback is called and this img element is passed there.
As the preview appears not immediately, it makes sense to display some placeholder instead of a preview until the image is ready. For example, you can use a div element with class equal to the iconCssClass value.
Inside the callback you can access the current file instance using this.
Example
For example, let's imagine you need to receive a preview for the first element in the upload list of 150px. The code may look like this:
var f = $au.imageUploaderFlash("Uploader1").files().get(0);
$("#preview").html("<div class=" + f.iconCssClass() + "></div>");
f.getPreview({
size: 150,
mode: 'crop',
callback: function(img) {
$("#preview").html(img);
}
});