Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Take a look at these two posts in the uploadify forum on how to handle errors</p> <p><a href="http://uploadify.com/forum/viewtopic.php?f=5&amp;t=12" rel="noreferrer"><em>onError to display what's happening</em></a> and <a href="http://uploadify.com/forum/viewtopic.php?f=5&amp;t=14" rel="noreferrer"><em>Upload script error reporting</em></a></p> <p>there is a lot of useful info in there ..</p> <p><strong><em>Update</em></strong></p> <p>The following seems to do the trick for me ..</p> <pre><code>'onComplete': function(a, b, c, d, e){ if (d !== '1') { alert(d); } else { alert('Filename: ' + c.name + ' was uploaded'); } } </code></pre> <p>coupled with this version of the uploadify script</p> <pre><code>&lt;?php if (!empty($_FILES)) { $tempFile = $_FILES['userfile']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/'; $targetFile = str_replace('//','/',$targetPath) . $_FILES['userfile']['name']; move_uploaded_file($tempFile,$targetFile); switch ($_FILES['userfile']['error']) { case 0: $msg = ""; // comment this out if you don't want a message to appear on success. break; case 1: $msg = "The file is bigger than this PHP installation allows"; break; case 2: $msg = "The file is bigger than this form allows"; break; case 3: $msg = "Only part of the file was uploaded"; break; case 4: $msg = "No file was uploaded"; break; case 6: $msg = "Missing a temporary folder"; break; case 7: $msg = "Failed to write file to disk"; break; case 8: $msg = "File upload stopped by extension"; break; default: $msg = "unknown error ".$_FILES['userfile']['error']; break; } } if ($msg) { $stringData = "Error: ".$_FILES['userfile']['error']." Error Info: ".$msg; } else { $stringData = "1"; } // This is required for onComplete to fire on Mac OSX echo $stringData; ?&gt; </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. 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