AtomUpload Plugin

This plugin provides Flash fallback as well. Flash fallback uses headers property to send extra items as query string. AtomUpload is derived from AtomItemsControl, items property contains an array of selected files for upload. You can customize itemTemplate property to change look and feel.

Properties

headers

Headers property can contain JavaScript object with key-value pair that will be added as query string in case of flash fallback. As Flash does not tranmit cookies, it is recommended that you can generate temporary Upload tokens that can be verified on server with query string.

upload-url

HTTP URL where files will be uploaded.

value

Value field contains comma separated properties of uploaded result specified as value-path property.

value-path

Path of property to bind for uploaded result.

Sample

Let's assume, server returns an object representing server's file storage model. Each item contains property 'result' which contains JavaScript object returned from server after successful upload.

        <div
            atom-type="AtomUploader"
            atom-upload-url="/Upload/UploadTemp"
            atom-value-path="TempFileID"
            atom-accept="image/*"
            atom-value="$[data.UploadedTempFileIDs]">
        </div>

 

Let's assume server returns following,

[{ TempFileID:1, Url: "http://a.b/a" }, { TempFileID:e, Url: "http://a.b/b" } ]

Then $data.UploadedTempFileIDs will contain '1,2'