calculate total size file input
<p>I have <code>input</code> like this:</p>

<pre><code>&lt;input type="file" name="upload[]" class="file" /&gt;
&lt;input type="file" name="upload[]" class="file" /&gt;
&lt;input type="file" name="upload[]" class="file" /&gt;
&lt;input type="file" name="upload[]" class="file" /&gt;
</code></pre>

<p>And I need to calculate <code>size</code> of all input.<br>
I tried code's :<br></p>

<pre><code>$(".file").each(function() {
   alert(this.files[0].size);
});
</code></pre>

<p>OR<br/></p>

<pre><code>$(".file").each(function(i) {
   alert(this.files[i].size);
});
</code></pre>

<p>But this code's don't work after <code>index 0</code>.</p>