I am new to development here i am unable to understand this problem. This code is working fine for image upload but not working for videos. I am using uploadify v2.1.4 to upload video files. if i upload some img file it properly uploads but video file and others use to upload completely but do not appear in destination.
PHP script
<?php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name']; // 1
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/'; // 2
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name']; // 3
if( move_uploaded_file($tempFile,$targetFile)){ // 4
echo true;
}else{
echo false;
}} ?>
js
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript" src="uploadify/swfobject.js"></script>
<script type="text/javascript" src="uploadify/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="uploadify/jquery.uploadify.v2.1.4.min.js"></script>
<link rel="stylesheet" type="text/css" href="uploadify/uploadify.css">
<script type="text/javascript" src="uploadify/jquery.uploadify.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#file_upload').uploadify({
'uploader' : 'uploadify/uploadify.swf',
'script' : 'vioup.php',
'cancelImg' : '/uploadify/cancel.png',
'folder' : '../uploads',
'auto' : true,
'multi' : false,
'fileDesc' : 'videos',
'fileExt' : '*.mp4'
});});