Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Do you know that you can get the <code>filename</code>, <code>filpath</code> inside the <code>onComplete</code> event like this:-</p> <pre><code>onComplete: function(event, queueID, fileObj, reponse, data) { alert fileObj.name; //The name of the uploaded file alert fileObj.filePath; //The path on the server to the uploaded file location.href= "complete.php?filename="+fileObj.name+"&amp;filepath="+fileObj.filePath; //Here you can do a javascript redirect } </code></pre> <p>Check the documentation for further details <a href="http://www.uploadify.com/documentation/events/oncomplete-2/" rel="nofollow">http://www.uploadify.com/documentation/events/oncomplete-2/</a></p> <p>Are you looking for those values? If not let me know</p> <p><strong>Updates</strong> </p> <p>As per your question updates, you have 2 options. </p> <p>Either to do the "some process" after the file upload in the uploadify.php. You can see the file <code>uploadify.php</code> which comes with the uploadify plugin. There you have the <code>$_FILES['Filedata']</code> array containing all the file info. You may do the post processing here itself (by calling a function better instead of writing lots of code in uploadify's core code)</p> <p><em>in uploadify.php</em><br> $_FILES['Filedata']['name'] //file name</p> <p>Or like I said, get the file name and path inside the <code>onComplete</code> event. Then pass these params like this :-</p> <pre><code> location.href= "complete.php?filename="+fileObj.name+"&amp;filepath="+fileObj.filePath; </code></pre> <p>I think this is better. You may send an ajax request instead to do the entire process (file upload + your "some process") without loading the page again. Write a <a href="http://api.jquery.com/jQuery.post/" rel="nofollow">$.post()</a> request inside the <code>onComplete</code> event with those parameters and post to "complete.php"</p> <p><strong>Getting parameters inside <code>onComplete</code> which are not available by default</strong> </p> <p>You have to use the <code>response</code> parameter available inside <code>onComplete</code> I worked on uploadify version 2.1.0 so my solution will work for sure on that version. If you want only one parameter, you can echo that at the end of <code>uploadify.php</code> I did the following thing:-</p> <p>In my <code>uploadify.php</code> changed (this was in the original uploadify.php):- </p> <pre><code>move_uploaded_file($tempFile,$targetFile); echo "1"; </code></pre> <p>to this:-</p> <pre><code>move_uploaded_file($tempFile,$targetFile); echo $tempFile; </code></pre> <p>and then inside the <code>onComplete</code> event did an explode - </p> <pre><code>var tmpName = reponse; </code></pre> <p>If however, you want to get more than one parameter inside <code>onComplete</code>, this is a trick I can give (this is not a good approach, but I was not able to return multiple params by any other way - I tried returning json array etc.):- </p> <pre><code>move_uploaded_file($tempFile,$targetFile); echo $param1.'%%__%%'.$param2; </code></pre> <p>and then inside the <code>onComplete</code> event did an explode - </p> <pre><code>var paramsArray = explode('%%__%%',reponse); param1 = paramsArray[0]; param2 = paramsArray[1]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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