src/cm/media/js/lib/yui/yui_3.10.3/docs/uploader/index.html
author gibus
Tue, 16 Jul 2013 14:29:46 +0200
changeset 525 89ef5ed3c48b
permissions -rw-r--r--
Upgrades to yui 3.10.3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
525
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     1
<!DOCTYPE html>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     2
<html lang="en">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     3
<head>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     4
    <meta charset="utf-8">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     5
    <title>Uploader</title>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     6
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     7
    <link rel="stylesheet" href="../../build/cssgrids/cssgrids-min.css">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     8
    <link rel="stylesheet" href="../assets/css/main.css">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
     9
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    10
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    11
    <script src="../../build/yui/yui-min.js"></script>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    12
    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    13
</head>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    14
<body>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    15
<!--
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    16
<a href="https://github.com/yui/yui3"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    17
-->
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    18
<div id="doc">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    19
    <div id="hd">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    20
        <h1><img src="http://yuilibrary.com/img/yui-logo.png"></h1>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    21
    </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    22
    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    23
        <a href="#toc" class="jump">Jump to Table of Contents</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    24
    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    25
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    26
            <h1>Uploader</h1>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    27
    <div class="yui3-g">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    28
        <div class="yui3-u-3-4">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    29
            <div id="main">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    30
                <div class="content"><style type="text/css">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    31
    .notice {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    32
        background: #faf3d1;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    33
        border: 1px solid #eac9a9;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    34
        -moz-border-radius: 3px;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    35
        -webkit-border-radius: 3px;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    36
        border-radius: px;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    37
        padding: 0 1em;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    38
        -moz-box-shadow: 0 0 5px #ccc8b3;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    39
        -webkit-box-shadow: 0 0 5px #ccc8b3;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    40
        box-shadow: 0 0 5px #ccc8b3;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    41
        margin-bottom: 1em;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    42
    }
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    43
    .notice h2 {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    44
        margin-top: .6em;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    45
    }
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    46
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    47
    .only {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    48
        vertical-align: super;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    49
        font-size: 9px;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    50
        background: #faf3d1;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    51
    }
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    52
</style>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    53
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    54
<div class="intro">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    55
   <p><strong>The YUI Uploader leverages HTML5+XMLHttpRequest 2 or Flash to provide file upload functionality beyond the basic HTTP <code>&lt;input type=&#x27;file&#x27;&gt;</code> capabilities.</strong> Specifically, the Uploader allows for:
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    56
	<ol>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    57
		<li> <strong>Multiple file selection</strong> in a single "Open File" dialog.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    58
        <li> <strong>Dragging-and-dropping files</strong> into the browser (when used in HTML5 mode).</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    59
        <li> <strong>Automatic upload queue management</strong> with fine-grained control.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    60
		<li> <strong>Upload progress tracking</strong>, both on a per-file and a per-queue basis.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    61
		<li> <strong>A range of available file metadata</strong>: filename, size, date created, and date modified.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    62
		<li> A set of <strong>events dispatched on various aspects of the file upload process</strong>: file selection, upload progress, upload completion, data return, and upload errors.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    63
		<li> Inclusion of <strong>additional data in the file upload POST request</strong>, on a file-by-file basis.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    64
        <li> <strong>Keyboard accessibility</strong> both in HTML5 and in Flash modes.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    65
	</ol>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    66
</div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    67
    <div class="notice">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    68
        <h2 id="migration-intro">Upgrading from version 3.4.1 or older?</h2>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    69
    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    70
        <p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    71
            Uploader has been refactored for 3.5.0.  Parts of its API have changed in backward-incompatible ways.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    72
        </p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    73
        
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    74
        <p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    75
            Read the <a href="migration.html">3.5.0 Migration Guide</a> for tips on a smooth transition.  
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    76
            If you still run into issues, please <a href="../../../projects/yui3/newticket/">file a ticket</a>.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    77
        </p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    78
    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    79
        <p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    80
            If you are unable to upgrade due to unresolvable issues, you can use the
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    81
            <a href="../uploader-deprecated/index.html"><code>uploader-deprecated</code></a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    82
            module suite, which is equivalent to the 3.4.1 implementation.  But be
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    83
            aware that this module will be removed in a future version of YUI.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    84
        </p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    85
    </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    86
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    87
<h2 id="getting-started">Getting Started</h2>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    88
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    89
<p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    90
To include the source files for Uploader and its dependencies, first load
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    91
the YUI seed file if you haven't already loaded it.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    92
</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    93
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    94
<pre class="code prettyprint">&lt;script src=&quot;http:&#x2F;&#x2F;yui.yahooapis.com&#x2F;3.10.3&#x2F;build&#x2F;yui&#x2F;yui-min.js&quot;&gt;&lt;&#x2F;script&gt;</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    95
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    96
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    97
<p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    98
Next, create a new YUI instance for your application and populate it with the
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
    99
modules you need by specifying them as arguments to the <code>YUI().use()</code> method.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   100
YUI will automatically load any dependencies required by the modules you
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   101
specify.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   102
</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   103
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   104
<pre class="code prettyprint">&lt;script&gt;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   105
&#x2F;&#x2F; Create a new YUI instance and populate it with the required modules.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   106
YUI().use(&#x27;uploader&#x27;, function (Y) {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   107
    &#x2F;&#x2F; Uploader is available and ready for use. Add implementation
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   108
    &#x2F;&#x2F; code here.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   109
});
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   110
&lt;&#x2F;script&gt;</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   111
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   112
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   113
<p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   114
For more information on creating YUI instances and on the
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   115
<a href="http://yuilibrary.com/yui/docs/api/classes/YUI.html#method_use"><code>use()</code> method</a>, see the
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   116
documentation for the <a href="../yui/index.html">YUI Global Object</a>.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   117
</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   118
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   119
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   120
<div class="intro">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   121
	<h2 id="uploader-usage-notes-for-the-flash-mode">Uploader Usage Notes for the Flash mode</h2>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   122
	<ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   123
	<li>Because of security requirements of the Flash Player, the <strong>Uploader in Flash mode must receive a direct user input</strong> in order to initiate file browsing.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   124
    <li><strong>The target server for file uploads must include a <code>crossdomain.xml</code> file</strong> that allows access from the location where the uploader SWF file is hosted.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   125
    See more in the <a href="#backend-setup">Backend Setup</a> section below, or read the <a href="http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html">crossdomain specification on Adobe's website</a>.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   126
    <li><strong>The relative URLs to the target server are resolved differently in the Flash mode</strong> than they are in the HTML5 mode. In Flash mode, the URLs
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   127
    are resolved relatively to the location of the SWF file, whereas in HTML5 mode, they are resolved relatively to the location of the web page. It is best to
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   128
    avoid using relative URLs for upload targets and use absolute URLs instead.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   129
    <li>The body of the server response to the Flash upload must be greater than 0 bytes. If its length is 0, then the upload is not registered as complete.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   130
	<li>Because of limitations of the Flash Player, the <strong>Uploader in Flash mode does not transmit session data (cookies)</strong> in the header of the POST requests it sends to the server. In order to transmit the session data, the developer will need to programmatically extract it from the DOM and send as part of the body of the POST request.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   131
  	<li>The <strong>Uploader SWF should always be served from an HTTP server</strong> due to Flash Player's restricted local security model.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   132
    <li>The <strong>Uploader control should not be placed in a container with <code>visibility</code> set to <code>hidden</code>, or <code>display</code> set to <code>none</code></strong>, whether at initialization of the page, or at any subsequent time. Because of how the Flash Player is instantiated, setting these properties to these values will result in the loss of communication between the Flash player and the DOM. If it's necessary to hide the instance of the Uploader on the page, its width and height should be set to 0.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   133
  	<li>The <strong>Uploader requires Flash Player 10.1 or higher</strong>. The latest version of Flash Player is available at the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   134
    <li>Because of a long-standing bug in Internet Explorer, the <strong>Uploader SWF does not function properly in IE when loaded from local cache</strong>. For that reason, in IE, the default URL for the SWF is appended with a random GET parameter to prevent loading from cache.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   135
    </ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   136
</div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   137
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   138
<div class="intro">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   139
    <h2 id="uploader-usage-notes-for-the-html5-mode">Uploader Usage Notes for the HTML5 mode</h2>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   140
    <ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   141
    <li>Because of security requirements of crossorigin requests in XMLHttpRequest Level 2, the <strong>Uploader in HTML5 mode sends out a preflight <code>OPTIONS</code> request to the target server</strong> for file uploads (if the target server is different from the one that is hosting the page originating the request). See the <a href="#backend-setup">Backend Setup</a> section below for more information, or read more about CORS on the <a href="http://www.html5rocks.com/en/tutorials/cors/#toc-handling-a-not-so-simple-request">HTML5Rocks website.</a></li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   142
    <li>Because of variations in browser support for multiple concurrent XMLHttpRequests, <strong>we recommend limiting the number of simultaneous uploads to 2</strong>.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   143
    </ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   144
</div>  			
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   145
			
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   146
				<h2 id="using-the-uploader">Using the Uploader</h2>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   147
			
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   148
				<p>In this section, we'll describe how to use the uploader in detail. First, let's look at the structure of the uploader module under the hood.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   149
				
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   150
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   151
				<h3 id="anatomy-of-the-uploader">Anatomy of the Uploader</h3>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   152
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   153
                <h4 id="progressive-enhancement">Progressive Enhancement</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   154
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   155
                <p>The Uploader consists of two classes, one of which is picked dynamically based on the functionality available on the end user's computer. For that reason, <code>Y.Uploader</code> is an alias that is dynamically assigned either to the <code>Y.UploaderHTML5</code> (for browsers that implement <em>XMLHttpRequest Level 2</em>) or <code>Y.UploaderFlash</code> (for browsers that include the Flash player plugin), or otherwise left as an unpopulated namespace when neither functionality is available. Before instantiating the Uploader, the developer can easily determine which of the three options has been loaded by checking the static <code>Y.Uploader.TYPE</code> property. This property resolves to either <code>&quot;html5&quot;</code>, <code>&quot;flash&quot;</code>, or <code>&quot;none&quot;</code>, and allows the developer to configure the uploader appropriately or otherwise load a different UI.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   156
                </p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   157
                <p>Due to the limitations of the Flash player, it is only possible to initiate the file selection dialog for Flash-supported file uploads with a direct user input to the Flash player. For that reason, and to maintain the API and configuration consistency, the Uploader is implemented as a "Select Files" button widget in both the HTML5 and the Flash modes. In case of HTML5 uploader, the interaction events are dispatched by the underlying UI control, whereas in case of the Flash uploader, a transparent Flash player overlay is placed on top of the control and captures all mouse events directly. The underlying UI control is customizable by the developer (the <code>selectFilesButton</code> attribute).
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   158
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   159
                <h4 id="hybrid-structure">Hybrid structure</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   160
                <p>In Flash mode, the Uploader uses the native functionality of the widely adopted Adobe Flash player to provide methods for sending
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   161
				   multiple files to the server and tracking the progress of the uploads. In order to control the Flash player, the Uploader uses the Flash player's built-in <code>ExternalInterface</code> class for communicating with JavaScript. <code>ExternalInterface</code> allows JavaScript to call exposed methods on an instance of a Flash player, and allows the instance of the Flash player to call arbitrary global methods in the global JavaScript space.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   162
				</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   163
				<p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   164
				   In order to properly instantiate the Flash player and communicate with it, the Uploader uses YUI SWF utility. The SWF utility
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   165
				   encapsulates the instance of the Flash player and standardizes communication with it (e.g., all Flash player method calls are
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   166
				   wrapped in SWF's <code>callSWF</code> function; correspondingly, all method calls from the Flash player are exposed as events dispatched by SWF.)
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   167
                </p>                
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   168
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   169
				<h3 id="instantiating-and-configuring-the-uploader">Instantiating and Configuring the Uploader</h3>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   170
                
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   171
                <h4 id="simple-instantiation">Simple Instantiation</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   172
				<p>To place the Uploader on the page, simply create a new instance of <code>Y.Uploader</code> and render it to the container in which it should be placed.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   173
                   Since <code>Y.Uploader</code> may not resolve to a fully-featured module if the required functionality is missing, test that the <code>Y.Uploader.TYPE</code> property
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   174
                   is not set to <code>&quot;none&quot;</code> first.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   175
                   It is recommended that you set fixed dimensions in the configurations for the uploader widget, because the underlying button UI control
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   176
                   is by default sized to 100% of the width and height of its parent:</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   177
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   178
<pre class="code prettyprint">YUI({...}).use(&#x27;uploader&#x27;,function (Y) {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   179
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   180
 if (Y.Uploader.TYPE != &quot;none&quot;) {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   181
    var uploader = new Y.Uploader({width: &quot;300px&quot;, 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   182
                                   height: &quot;40px&quot;}).render(&quot;#uploaderContainerID&quot;);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   183
 }
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   184
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   185
});</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   186
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   187
<h4 id="manual-uploader-type-override">Manual Uploader Type Override</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   188
<p>With the above instantiation, you are allowing the Uploader to automatically choose whether to use <code>UploaderHTML5</code> or <code>UploaderFlash</code> as the underlying module. You can always use those modules directly or manually override the alias as follows:
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   189
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   190
<pre class="code prettyprint">YUI({...}).use(&#x27;uploader&#x27;,&#x27;uploader-flash&#x27;, function (Y) {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   191
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   192
Y.Uploader = Y.UploaderFlash;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   193
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   194
&#x2F;&#x2F; or
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   195
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   196
Y.Uploader = Y.UploaderHTML5;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   197
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   198
var uploader = new Y.Uploader(...);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   199
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   200
});</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   201
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   202
</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   203
<h4 id="features-based-on-available-functionality">Features Based on Available Functionality</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   204
<p>You can further use the <code>Y.Uploader.TYPE</code> property to add functionality-specific features to the Uploader based on whether HTML5 or Flash are available. For instance, in the following code snippet, if the Uploader is in HTML5 mode, we assign it a drag-and-drop area where files can be dragged directly into the browser
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   205
(functionality which is unavailable in Flash). If it's in Flash mode, we provide a <code>fileFilters</code> configuration which allows the selection dialog to filter
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   206
files by extension (functionality only available in Flash):
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   207
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   208
<pre class="code prettyprint">YUI({...}).use(&#x27;uploader&#x27;, function (Y) {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   209
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   210
   var uploader = new Y.Uploader(...);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   211
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   212
   if (Y.Uploader.TYPE == &quot;html5&quot;) {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   213
       uploader.set(&quot;dragAndDropArea&quot;, &quot;#divContainer&quot;);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   214
       uploader.render(&quot;#selectFilesButtonContainer&quot;);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   215
   }
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   216
   else if (Y.Uploader.TYPE == &quot;flash&quot;) {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   217
       uploader.set(&quot;fileFilters&quot;, [{description:&quot;Images&quot;, extensions:&quot;*.jpg;*.png;*.gif&quot;},
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   218
                                    {description:&quot;Videos&quot;, extensions:&quot;*.avi;*.mov;*.mpg&quot;}]);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   219
       uploader.render(&quot;#selectFilesButtonContainer&quot;);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   220
   }
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   221
   else {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   222
       Y.log(&quot;No Flash or HTML5 capabilities detected.&quot;); 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   223
   }
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   224
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   225
});</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   226
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   227
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   228
<h4 id="uploader-configuration-attributes">Uploader Configuration Attributes</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   229
<p>The following configuration attributes are specific to the Uploader:</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   230
             <table>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   231
                <thead>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   232
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   233
                        <th>Attribute</th>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   234
                        <th>Description</th>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   235
                        <th>Default</th>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   236
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   237
                </thead>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   238
                <tbody>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   239
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   240
                        <td><code>appendNewFiles</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   241
                        <td>A Boolean indicating whether newly selected files should be appended to the existing file list, or whether they should replace it.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   242
                        <td><code>true</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   243
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   244
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   245
                        <td><code>buttonClassNames</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   246
                        <td>The names of CSS classes that correspond to different button states of the "Select Files" control. These classes are assigned to the "Select Files" control based on the mouse states reported by the Flash player or by the state of the HTML5 Uploader. The keys for the class names are:
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   247
                            <ul>                               
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   248
                               <li><code>hover</code>: the class corresponding to mouse hovering over the "Select Files" button.<span class="only">UploaderFlash</span></li>    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   249
                               <li><code>active</code>: the class corresponding to mouse down state of the "Select Files" button.<span class="only">UploaderFlash</span></li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   250
                               <li><code>disabled</code>: the class corresponding to the disabled state of the "Select Files" button.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   251
                               <li><code>focus</code>: the class corresponding to the focused state of the "Select Files" button.<span class="only">UploaderFlash</span></li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   252
                            </ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   253
                        </td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   254
                        <td><pre>{ 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   255
hover: 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   256
"yui3-button-hover", 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   257
active: 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   258
"yui3-button-active", 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   259
disabled: 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   260
"yui3-button-disabled", 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   261
focus: 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   262
"yui3-button-selected" 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   263
}</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   264
                        </td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   265
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   266
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   267
                        <td><code>dragAndDropArea</code><span class="only">UploaderHTML5</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   268
                        <td>The node that serves as the drop target for files.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   269
                        <td><code>null</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   270
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   271
                     <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   272
                        <td><code>enabled</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   273
                        <td>A Boolean indicating whether the uploader is enabled or disabled for user input.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   274
                        <td><code>true</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   275
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   276
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   277
                        <td><code>errorAction</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   278
                        <td>The action performed when an upload error occurs for a specific file being uploaded. The possible values are:
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   279
                            <ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   280
                             <li><code>Y.Uploader.Queue.CONTINUE</code>: the error is ignored and the upload process is continued.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   281
                             <li><code>Y.Uploader.Queue.STOP</code>: the upload process is stopped as soon as any other parallel file uploads are finished.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   282
                             <li><code>Y.Uploader.Queue.RESTART_ASAP</code>: the file is added back to the front of the queue.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   283
                             <li><code>Y.Uploader.Queue.RESTART_AFTER</code>: the file is added to the back of the queue.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   284
                            </ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   285
                        </td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   286
                        <td><code>Y.Uploader.Queue.CONTINUE</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   287
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   288
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   289
                        <td><code>fileFieldName</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   290
                        <td>A String specifying what should be the POST field name for the file content in the upload request.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   291
                        <td><code>&quot;Filedata&quot;</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   292
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   293
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   294
                        <td><code>fileFilters</code><span class="only">UploaderFlash</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   295
                        <td>An array indicating what fileFilters should be applied to the file selection dialog. Each element in the 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   296
                            array should be an object with the following key-value pairs: 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   297
<pre class="code prettyprint">{ description : String,
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   298
  extensions: String of the form&quot;.&quot;ext1;.ext2;*.ext3;...&quot; 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   299
}</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   300
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   301
                        </td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   302
                        <td><code>null</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   303
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   304
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   305
                        <td><code>fileList</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   306
                        <td>The array of files to be uploaded. All elements in the array must be instances of <code>Y.File</code> and be properly instantiated
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   307
                            depending on whether <code>UploaderHTML5</code> or <code>UploaderFlash</code> is being used.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   308
                        <td><code>[]</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   309
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   310
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   311
                        <td><code>multipleFiles</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   312
                        <td>A Boolean indicating whether multiple file selection is enabled.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   313
                        <td><code>false</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   314
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   315
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   316
                        <td><code>postVarsPerFile</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   317
                        <td>An object, keyed by fileId, containing sets of key-value pairs that should be passed as POST variables along with each 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   318
                            corresponding file. This attribute is only used if no POST variables are specified in the upload method call.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   319
                        <td><code>{}</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   320
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   321
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   322
                        <td><code>selectButtonLabel</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   323
                        <td>The label for the "Select Files" widget. This is the value that replaces the <code>{selectButtonLabel}</code> token in the 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   324
                            <code>Y.Uploader.SELECT_FILES_BUTTON</code> template.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   325
                        <td><code>&quot;Select Files&quot;</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   326
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   327
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   328
                        <td><code>selectFilesButton</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   329
                        <td>The widget that serves as the "Select Files" control for the file uploader.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   330
                        <td><code>HTML Button with YUI3 CSS Button skin</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   331
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   332
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   333
                        <td><code>simLimit</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   334
                        <td>The number of files that can be uploaded simultaneously if the automatic queue management is used. 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   335
                            This value can be in the range between 2 and 5, with the value of 1 or 2 recommended.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   336
                        <td><code>2</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   337
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   338
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   339
                        <td><code>swfURL</code><span class="only">UploaderFlash</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   340
                        <td>The URL to the SWF file of the flash uploader. A copy local to the server that hosts the page on 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   341
                            which the uploader appears (rather than a CDN-sourced uploader) is recommended.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   342
                        <td><code>CDN Prefix</code> + <code>uploader&#x2F;assets&#x2F;flashuploader.swf</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   343
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   344
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   345
                        <td><code>tabElements</code><span class="only">UploaderFlash</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   346
                        <td>The <code>id</code>'s or Node references of the DOM elements that precede and follow the "Select Files" button in the tab order. 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   347
                            Specifying these allows keyboard navigation to and from the Flash player layer of the uploader. The two keys 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   348
                            corresponding to the DOM elements are:
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   349
                            <ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   350
                             <li><code>from</code>: the id or the Node reference corresponding to the DOM element that precedes the Select Files button in the tab order.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   351
                             <li><code>to</code>: the id or the Node reference corresponding to the DOM element that follows the Select Files button in the tab order.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   352
                            </ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   353
                        </td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   354
                        <td><code>null</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   355
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   356
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   357
                        <td><code>uploadURL</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   358
                        <td>The URL to which file upload requested are POSTed. Only used if a different url is not passed to the upload method call.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   359
                        <td><code>&quot;&quot;</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   360
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   361
                </tbody>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   362
                </table>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   363
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   364
<h4 id="multiple-file-selection">Multiple file selection</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   365
<p>While the file selection dialog in the Uploader is standard for the user's specific operating system, you can specify whether you want the user to be able to select multiple files, or just one:</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   366
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   367
<pre class="code prettyprint">uploader.set(&quot;multipleFiles&quot;, true);</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   368
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   369
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   370
<h3 id="the-upload-process">The Upload Process</h3>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   371
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   372
<h4 id="automatic-queue-management">Automatic Queue Management</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   373
<p> After the user has selected a file (or files) to be uploaded, the selected file list is places into the <code>fileList</code> attribute of the Uploader. At that point, 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   374
    you can either have the user initialize the actual upload process, or initialize it automatically, without any additional user action.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   375
<p> Each of the selected files is uploaded in its own POST request. You can either upload each file individually, and manage the queue on your own, or use the Uploader's built-in queue management. To upload a single file "manually" (without using automatic queue management), the following method call can be made:</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   376
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   377
<pre class="code prettyprint">var firstFile = uploader.get(&quot;fileList&quot;)[0];
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   378
uploader.upload(firstFile, &quot;http:&#x2F;&#x2F;url.to&#x2F;upload.php&quot;, {postvar1: &quot;foo&quot;, postvar2: &quot;bar&quot;});</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   379
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   380
<p> To upload all files using the built-in queue manager, you can call the <code>uploadAll()</code> method:</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   381
<pre class="code prettyprint">uploader.uploadAll(&quot;http:&#x2F;&#x2F;url.to&#x2F;upload.php&quot;);</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   382
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   383
<p> You can also upload a subset of the provided files, using the <code>uploadThese()</code> method: </p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   384
<pre class="code prettyprint">var firstFive = uploader.get(&quot;fileList&quot;).slice(0,5);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   385
uploader.uploadThese(firstFive, &quot;upload.php&quot;);</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   386
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   387
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   388
<h4 id="monitoring-upload-progress">Monitoring Upload Progress</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   389
<p>When using the automatic queue management, you can monitor the overall upload progress by subscribing to the <code>totaluploadprogress</code> event, which reports the number of bytes uploaded, the total number of bytes, and the percentage of the upload completed:</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   390
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   391
<pre class="code prettyprint">uploader.on(&quot;totaluploadprogress&quot;, reportProgress);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   392
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   393
function reportProgress (event) {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   394
	Y.log(&quot;Bytes uploaded: &quot; + event.bytesLoaded);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   395
        Y.log(&quot;Bytes remaining: &quot; + (event.bytesTotal - event.bytesLoaded));
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   396
        Y.log(&quot;Percent uploaded: &quot; + event.percentLoaded);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   397
}</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   398
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   399
<p>Individual file upload progress is also reported, via the <code>uploadprogress</code>, <code>uploadcomplete</code>, and <code>uploaderror</code> events described below.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   400
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   401
<h4 id="custom-queue-control">Custom Queue Control</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   402
<p>During the automatic queue management of multiple files, you can call various methods on the Uploader queue (available as <code>uploaderInstance.queue</code>)
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   403
   in order to control the file upload. The methods available to you include:
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   404
   <ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   405
     <li><strong>addToQueueTop()</strong> and <strong>addToQueueBottom()</strong>: allow you to include additional files in the upload queue, either at the
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   406
         beginning or at the end.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   407
     <li><strong>cancelUpload()</strong>: cancel a specific file's upload. If no arguments are passed, all of the uploads are cancelled.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   408
     <li><strong>forceReupload()</strong>: if a particular file is stuck in an ongoing upload without any progress events, you can force its reupload.
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   409
         This method is equivalent to cancelling the file's upload and then adding it back to the queue.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   410
     <li><strong>pauseUpload()</strong>: complete all currently ongoing uploads, but ceases starting new ones, until <strong>startUpload()</strong> is called.</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   411
   </ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   412
<p>For more information, see the <a href="http://yuilibrary.com/yui/docs/api/classes/Uploader.Queue.html">API Docs for Uploader.Queue</a>.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   413
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   414
<h3 id="uploader-events">Uploader events</h3>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   415
    <p>Uploader fires the following events during operation:</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   416
        <table>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   417
                <thead>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   418
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   419
                        <th>Event</th>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   420
                        <th>Cause</th>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   421
                        <th>Payload</th>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   422
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   423
                </thead>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   424
                <tbody>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   425
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   426
                        <td><code>alluploadscomplete</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   427
                        <td>Signals that the upload process of the entire file list has been completed.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   428
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   429
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   430
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   431
                        <td><code>click</code><span class="only">UploaderFlash</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   432
                        <td>Signals that a mouse has been clicked over the <code>Select Files</code> button.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   433
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   434
                    </tr> 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   435
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   436
                        <td><code>dragenter</code><span class="only">UploaderHTML5</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   437
                        <td>Signals that a dragged object has entered into the uploader's associated drag-and-drop area (if one is specified).</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   438
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   439
                    </tr> 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   440
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   441
                        <td><code>dragleave</code><span class="only">UploaderHTML5</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   442
                        <td>Signals that a dragged object has entered into the uploader's associated drag-and-drop area (if one is specified).</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   443
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   444
                    </tr> 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   445
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   446
                        <td><code>dragleave</code><span class="only">UploaderHTML5</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   447
                        <td>Signals that an object has been dragged off of the uploader's associated drag-and-drop area (if one is specified).</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   448
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   449
                    </tr> 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   450
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   451
                        <td><code>dragover</code><span class="only">UploaderHTML5</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   452
                        <td>Signals that an object has been dragged over the uploader's associated drag-and-drop area (if one is specified).</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   453
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   454
                    </tr> 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   455
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   456
                        <td><code>drop</code><span class="only">UploaderHTML5</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   457
                        <td>Signals that an object has been dropped over the uploader's associated drag-and-drop area (if one is specified).</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   458
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   459
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   460
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   461
                        <td><code>fileselect</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   462
                        <td>Signals that files have been selected.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   463
                        <td><code>fileList</code>: An Array of files selected by the user, encapsulated in <code>Y.File</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   464
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   465
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   466
                        <td><code>fileuploadstart</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   467
                        <td>Signals that the upload of multiple files has been started.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   468
                        <td><p><code>file</code>: A reference to the instance of <code>Y.File</code> that dispatched the event.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   469
                            <p><code>originEvent</code>: The original event dispatched by <code>Y.File</code></p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   470
                        </td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   471
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   472
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   473
                        <td><code>mousedown</code><span class="only">UploaderFlash</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   474
                        <td>Signals that a mouse has been pressed over the <code>Select Files</code> button.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   475
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   476
                    </tr> 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   477
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   478
                        <td><code>mouseenter</code><span class="only">UploaderFlash</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   479
                        <td>Signals that a mouse has begun hovering over the <code>Select Files</code> button.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   480
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   481
                    </tr> 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   482
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   483
                        <td><code>mouseleave</code><span class="only">UploaderFlash</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   484
                        <td>Signals that a mouse has stopped hovering over the <code>Select Files</code> button.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   485
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   486
                    </tr> 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   487
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   488
                        <td><code>mouseup</code><span class="only">UploaderFlash</span></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   489
                        <td>Signals that a mouse has been released over the <code>Select Files</code> button.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   490
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   491
                    </tr> 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   492
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   493
                        <td><code>totaluploadprogress</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   494
                        <td>Reports on the total upload progress of the file list.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   495
                        <td><p><code>bytesLoaded</code>: The number of bytes of the file list that has been uploaded.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   496
                            <p><code>bytesTotal</code>: The total number of bytes in the file list.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   497
                            <p><code>percentLoaded</code>: The fraction of the file list that has been uploaded, out of 100.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   498
                        </td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   499
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   500
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   501
                        <td><code>uploadcomplete</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   502
                        <td>Signals that a single file upload has been completed.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   503
                        <td><p><code>originEvent</code>: The original event dispatched by the instance of <code>Y.File</code>.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   504
                            <p><code>file</code>: The pointer to the instance of <code>Y.File</code> that dispatched the event.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   505
                            <p><code>data</code>: The data returned by the server.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   506
                        </td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   507
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   508
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   509
                        <td><code>uploaderror</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   510
                        <td>Signals that a error has occurred in a specific file's upload process.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   511
                        <td><p><code>originEvent</code>: The original event dispatched by the Uploader.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   512
                            <p><code>file</code>: The pointer to the instance of <code>Y.File</code> that dispatched the event.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   513
                            <p><code>source</code>: Either 'io' or 'http'.<span class="only">UploaderFlash</span></p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   514
                            <p><code>message</code>: The message corresponding to the error. In case of HTTP errors contains the status code.<span class="only">UploaderFlash</span></p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   515
                            <p><code>status</code>: The status reported by the XMLHttpRequest object.<span class="only">UploaderHTML5</span></p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   516
                            <p><code>statusText</code>: The status text reported by the XMLHttpRequest object.<span class="only">UploaderHTML5</span></p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   517
                        </td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   518
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   519
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   520
                        <td><code>uploadprogress</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   521
                        <td>Reports on upload progress of a specific file.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   522
                        <td><p><code>file</code>: The pointer to the instance of <code>Y.File</code> that dispatched the event.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   523
                            <p><code>bytesLoaded</code>: The number of bytes of the file that has been uploaded.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   524
                            <p><code>bytesTotal</code>: The total number of bytes in the file.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   525
                            <p><code>percentLoaded</code>: The fraction of the file that has been uploaded, out of 100.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   526
                            <p><code>originEvent</code>: The original event dispatched by the uploader transport.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   527
                        </td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   528
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   529
                    <tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   530
                        <td><code>uploadstart</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   531
                        <td>Signals that an upload of multiple files has been started.</td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   532
                        <td><code>None</code></td>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   533
                    </tr>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   534
                </tbody>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   535
                </table>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   536
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   537
                <p>See the API documentation for <a href="http://yuilibrary.com/yui/docs/api/classes/UploaderHTML5.html">UploaderHTML5</a> and <a href="http://yuilibrary.com/yui/docs/api/classes/UploaderFlash.html">UploaderFlash</a> for a complete documentation of the Uploader events, methods, attributes, and properties.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   538
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   539
<h3 id="backend-setup">Backend Setup</h3>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   540
<h4 id="setting-up-the-backend-for-flash">Setting up the backend for Flash</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   541
<p>Unless the server receiving the file uploads is located on the same domain as the SWF file that is dispatching the uploads, the receiving server must include a <strong>crossdomain.xml</strong> file allowing the server on which the SWF is located to make requests to it. Consider, for instance, the <a href="http://www.yahoo.com/crossdomain.xml"><strong>crossdomain.xml</strong> policy file on yahoo.com</a>. It looks as follows:</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   542
<pre class="code prettyprint">&lt;cross-domain-policy&gt;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   543
&lt;allow-access-from domain=&quot;*.yahoo.com&quot; secure=&quot;false&quot;&#x2F;&gt;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   544
&lt;&#x2F;cross-domain-policy&gt;</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   545
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   546
<p>The <code>allow-access-from</code> parameter specifies which domains hosting SWFs can access yahoo.com: in this case, only subdomains of yahoo.com are allowed to do so. Note, for instance, that <a href="http://www.cnn.com/crossdomain.xml">CNN.com's list</a> is considerably larger.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   547
<p>If you are planning on using the CDN-hosted Uploader SWF, your crossdomain.xml file might look something like this:</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   548
<pre class="code prettyprint">&lt;cross-domain-policy&gt;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   549
&lt;allow-access-from domain=&quot;yui.yahooapis.com&quot; secure=&quot;false&quot;&#x2F;&gt;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   550
&lt;&#x2F;cross-domain-policy&gt;</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   551
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   552
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   553
<h4 id="setting-up-the-backend-for-html5">Setting up the backend for HTML5</h4>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   554
<p>The security policy for XMLHttpRequest Level 2 cross-domain requests is a little bit trickier. Instead of using separate files, XHR2 uses server-supplied headers to determine whether a request can be made. Before the regular POST request, XHR submits a preflight OPTIONS request with an <code>Origin</code> parameter. In response, it expects a <code>Access-Control-Allow-Origin</code> header with a wildcard or a URL matching the <code>Origin</code> parameter it sent. This header can be set either through the web server you are using, or directly by the script output. For instance, here is a PHP example that replies to the OPTIONS requests with a header allowing all origins:</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   555
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   556
<pre class="code prettyprint">if ($_SERVER[&#x27;REQUEST_METHOD&#x27;] == &#x27;OPTIONS&#x27;) {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   557
 header(&#x27;Access-Control-Allow-Origin: *&#x27;);
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   558
 exit;
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   559
}</pre>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   560
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   561
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   562
<p>Note that the actual response must also contain the <code>Access-Control-Allow-Origin</code> header.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   563
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   564
<p>To learn more about XHR2 cross-domain requests, read <a href="http://www.html5rocks.com/en/tutorials/cors/">this helpful tutorial on html5rocks.com</a>.</p>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   565
</div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   566
            </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   567
        </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   568
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   569
        <div class="yui3-u-1-4">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   570
            <div class="sidebar">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   571
                
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   572
                    <div id="toc" class="sidebox">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   573
                        <div class="hd">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   574
                            <h2 class="no-toc">Table of Contents</h2>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   575
                        </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   576
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   577
                        <div class="bd">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   578
                            <ul class="toc">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   579
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   580
<a href="#migration-intro">Upgrading from version 3.4.1 or older?</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   581
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   582
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   583
<a href="#getting-started">Getting Started</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   584
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   585
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   586
<a href="#uploader-usage-notes-for-the-flash-mode">Uploader Usage Notes for the Flash mode</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   587
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   588
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   589
<a href="#uploader-usage-notes-for-the-html5-mode">Uploader Usage Notes for the HTML5 mode</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   590
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   591
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   592
<a href="#using-the-uploader">Using the Uploader</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   593
<ul class="toc">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   594
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   595
<a href="#anatomy-of-the-uploader">Anatomy of the Uploader</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   596
<ul class="toc">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   597
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   598
<a href="#progressive-enhancement">Progressive Enhancement</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   599
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   600
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   601
<a href="#hybrid-structure">Hybrid structure</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   602
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   603
</ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   604
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   605
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   606
<a href="#instantiating-and-configuring-the-uploader">Instantiating and Configuring the Uploader</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   607
<ul class="toc">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   608
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   609
<a href="#simple-instantiation">Simple Instantiation</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   610
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   611
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   612
<a href="#manual-uploader-type-override">Manual Uploader Type Override</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   613
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   614
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   615
<a href="#features-based-on-available-functionality">Features Based on Available Functionality</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   616
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   617
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   618
<a href="#uploader-configuration-attributes">Uploader Configuration Attributes</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   619
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   620
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   621
<a href="#multiple-file-selection">Multiple file selection</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   622
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   623
</ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   624
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   625
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   626
<a href="#the-upload-process">The Upload Process</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   627
<ul class="toc">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   628
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   629
<a href="#automatic-queue-management">Automatic Queue Management</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   630
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   631
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   632
<a href="#monitoring-upload-progress">Monitoring Upload Progress</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   633
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   634
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   635
<a href="#custom-queue-control">Custom Queue Control</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   636
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   637
</ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   638
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   639
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   640
<a href="#uploader-events">Uploader events</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   641
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   642
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   643
<a href="#backend-setup">Backend Setup</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   644
<ul class="toc">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   645
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   646
<a href="#setting-up-the-backend-for-flash">Setting up the backend for Flash</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   647
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   648
<li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   649
<a href="#setting-up-the-backend-for-html5">Setting up the backend for HTML5</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   650
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   651
</ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   652
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   653
</ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   654
</li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   655
</ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   656
                        </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   657
                    </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   658
                
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   659
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   660
                
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   661
                    <div class="sidebox">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   662
                        <div class="hd">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   663
                            <h2 class="no-toc">Examples</h2>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   664
                        </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   665
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   666
                        <div class="bd">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   667
                            <ul class="examples">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   668
                                
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   669
                                    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   670
                                        <li data-description="A simple multiple file uploader with progress tracking">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   671
                                            <a href="uploader-multiple.html">Simple Multiple Files Uploader with Progress Tracking</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   672
                                        </li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   673
                                    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   674
                                
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   675
                                    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   676
                                        <li data-description="A multiple file uploader with HTML5 Drag-and-Drop Support">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   677
                                            <a href="uploader-dd.html">Multiple Files Uploader with HTML5 Drag-and-Drop Support</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   678
                                        </li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   679
                                    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   680
                                
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   681
                                    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   682
                                        <li data-description="A multiple file uploader that submits additional POST vars with each file and receives data from the server">
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   683
                                            <a href="uploader-data.html">Multiple Files Uploader with POST Variables and Server Data Retrieval</a>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   684
                                        </li>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   685
                                    
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   686
                                
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   687
                            </ul>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   688
                        </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   689
                    </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   690
                
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   691
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   692
                
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   693
            </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   694
        </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   695
    </div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   696
</div>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   697
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   698
<script src="../assets/vendor/prettify/prettify-min.js"></script>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   699
<script>prettyPrint();</script>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   700
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   701
<script>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   702
YUI.Env.Tests = {
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   703
    examples: [],
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   704
    project: '../assets',
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   705
    assets: '../assets/uploader',
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   706
    name: 'uploader',
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   707
    title: 'Uploader',
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   708
    newWindow: '',
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   709
    auto:  false 
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   710
};
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   711
YUI.Env.Tests.examples.push('uploader-multiple');
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   712
YUI.Env.Tests.examples.push('uploader-dd');
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   713
YUI.Env.Tests.examples.push('uploader-data');
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   714
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   715
</script>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   716
<script src="../assets/yui/test-runner.js"></script>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   717
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   718
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   719
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   720
</body>
89ef5ed3c48b Upgrades to yui 3.10.3
gibus
parents:
diff changeset
   721
</html>