Note that there are some explanatory texts on larger screens.

plurals
  1. POUpload video using uploadify latest version
    primarykey
    data
    text
    <p>I want to upload video using uploadify newest version, but I failed.</p> <p>My code:</p> <p><strong>HTML:</strong></p> <pre><code>&lt;form enctype="multipart/form-data" class="form-part" action="form.php" method="post"&gt; &lt;input class="uplodify" id="file_upload" type="file"/&gt; &lt;/form&gt; </code></pre> <p><strong>jQuery:</strong></p> <pre><code>$('#file_upload').uploadify({ swf: 'uploadify/uploadify.swf', uploader: 'uploadify/uploadify.php', multi: true, //queueSizeLimit: 3, fileExt: '*.jpg;*.gif;*.png;*.mp4;*.mp3;*.avi;*.wmv;*.flv;', auto: true, onUploadStart: function(file) { console.log(file); }, onUploadComplete: function(event, ID, fileObj, response, data) { }, onUploadError : function(file, errorCode, errorMsg, errorString) { alert('The file ' + file.name + ' could not be uploaded: ' + errorString); }, onUploadSuccess : function(file, data, response) { console.log('The file ' + file.name + ' was successfully uploaded with a response of ' + response + ':' + data); } }); </code></pre> <p><strong>PHP:</strong></p> <pre><code>error_reporting(0); $targetFolder = '/uploads'; // Relative to the root if (!empty($_FILES)) { $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = dirname(dirname(__FILE__)) . $targetFolder; $targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name']; // Validate the file type $fileTypes = array('jpg','jpeg','gif','png', 'mp3', 'mp4', 'avi', 'flv', 'wmv'); // File extensions $fileParts = pathinfo($_FILES['Filedata']['name']); if (in_array($fileParts['extension'],$fileTypes)) { move_uploaded_file($tempFile,$targetFile); echo '1'; } else { echo 'Invalid file type.'; } } </code></pre> <p><strong>NOTE:</strong> No error in the <code>console</code></p> <p><code>onUploadSuccess()</code> log is : <em>The file easyhtm-wp.FLV was successfully uploaded with a response of true:Invalid file type.</em></p> <p>Just immediate after this line a warning shown in console as:</p> <p>Please help me with this.</p> <p>Thanks.</p>
    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.
 

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