Note that there are some explanatory texts on larger screens.

plurals
  1. POvalums file uploader: size value for onComplete, list item hooks, and file overwrite options
    text
    copied!<p>I am using Valum's file uploader:<br /> <a href="http://valums.com/ajax-upload/" rel="nofollow">http://valums.com/ajax-upload/</a></p> <p>To upload files via PHP.</p> <p>1. I would like to use the size of the file upload in the onComplete call, but I do no know how to get the size of the file just uploaded. I know how to get the fileName using this,</p> <pre><code>onComplete: function(id, fileName, responseJSON){ fileName //is the filename, but what about the file size? } </code></pre> <p>But I do not know how to get the file name (from the JavaScript, through PHP I can but that isn't much help here).</p> <p>2. Also during the onComplete call, I would like to be able to access the list item <code>&lt;li&gt;</code> that the file upload script creates below the upload button. When I inspect them with fire-bug I can only see that they have a class, and not an ID. I want to hide each one once I have complete the other stuff in my onComplete, but do not want to also hide the rest of the files in the queue.</p> <p>3. When a file is being uploaded, If the file already exists I would like a message to pop-up and ask the user if they want to overwrite the file. I would like there to then be 3 options, one where the file is not overwritten and the upload is cancelled, one where the file is not overwritten, but the new file is uploaded and a version number is added (eg, test.txt becomes testv2.txt, similar to the default now), and three where the old file is overwritten with the new file.</p> <p>I can probably figure out the PHP to this quite easily, but what I need help with is understanding how the variables are passed between the pages using json/jquery/ajax/etc.</p> <p>Any help with any of these questions would be much appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload