0

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'   
 });});
Fractaliste
  • 5,777
  • 11
  • 42
  • 86
  • 2
    possible duplicate of [PHP change the maximum upload file size](http://stackoverflow.com/questions/2184513/php-change-the-maximum-upload-file-size) – Ben Jan 28 '14 at 01:35
  • i am using Uploadify to upload files. – user3236386 Jan 28 '14 at 01:42
  • IMO, this is *not* a duplicate, as per this meta post: http://meta.stackexchange.com/questions/213976/should-i-mark-as-duplicate-if-the-question-is-answered-elsewhere-but-its-not-t – Cory Klein Jan 28 '14 at 16:11
  • Do you have any log files or anything to give more hints? Is the server being connected to successfully? Did you try a different mechanism for upload? – James Kingsbery Jan 28 '14 at 16:28

1 Answers1

0

I use 2.1.4 & 3.2, but even the older versions had a file called uploadify.php. When setting extensions, they needed to be in the 'document ready', and in the uploadify.php. This is the actual upload program. It appears you are using vioup.php, check if the '*.mp4' extension is set in there.

Tom aka Sparky
  • 76
  • 1
  • 11