files.add(String,String) Method HTML5/Flash Uploader JavaScript

Supported technologies:

Adds an item to the upload list with the specified name and content.

Syntax

JavaScript
$au.imageUploaderFlash('uploaderID').files().add(body, name);

Parameters

body

Type: String

A file body. It may be a base64-encoded string. Alternatively, you can pass a Blob object.
name

Type: String

A string which will be sent to the server as a file name. It may contain a relative folder structure (like folder1\folder2\file.jpg).

Remarks

You can use this method to add files generated in your JavaScript to the upload list. In particular, you may copy the upload list from Java uploader to HTML5 uploader instance.

Note

It does not inserts files from the file system by the file name (it is impossible due to the security reasons). The name argument is used only to specify what name to send to the server.