Jump to content

Video file not moving to destination


Cbrass

Recommended Posts

hello friends please help me out here, i have been trying to upload a video file using WAMP, the problem is the file doesnt upload and no error is given, i have even tried thesame script for other files like images and audio and they all uploaded but its the video file that wont upload. this is my code

<html>
<head>
</head>

<?php
include"header.php";
include"create_thumbs.php";
if(isset($_POST['submit']))
{
$title = mysql_real_escape_string($_POST['title']);
if(!empty($title))
{
//creating time stamp//
      $time = $title;
     //getting the uploaded file//
     $pics = $_FILES['ffile']['name'];
     //split the file from the extension//
      $extn = explode(".",$pics);
      //end fle extension//
      $file_extn = end($extn);
      //combine the new filename with the extension//
      $vid = strtolower($time.'.'.$file_extn);
      $upload="uploads/";
      $upload=$upload.basename($vid);
      $move=move_uploaded_file($_FILES['ffile']['tmp_name'],$upload);
$ins = "INSERT INTO box(title,video,time) VALUES('$title','$vid',NOW())";
$inst = mysql_query($ins) or die(mysql_error());
if($inst) echo"file uploaded";
}
else
{
echo"error uploading fields";
}
}
?>


<form action="" method="post" enctype="multipart/form-data">
Title</br><input type="text" name="title" placeholder="video title goes here" size="30" required /></br>
<input type="file" name="ffile" /></br>
<input type="submit" value="upload" name="submit" />
</form>
</body>
</html>
Link to comment
Share on other sites

I think of few things: File size, File type, folder permissions, invalid code. But if your able to upload other files it won't be the permissions or invalid code so I am focused on File size and File type.

 

I'll give it a crack to try trouble shoot with you, I am curious on the result.

 

How big are the video files that you are trying to upload? if bigger then 30000 bytes you need to change in your php.ini file: MAX_FILE_SIZE

 

Reference: http://www.php.net/manual/en/features.file-upload.post-method.php

Reference: http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize (For the php.ini details and max file size)

    <!-- MAX_FILE_SIZE must precede the file input field -->
    <input type="hidden" name="MAX_FILE_SIZE" value="30000" />

What video file type are you using? By the look of the php manual bible does not having much on file type, but try the max size setup see if that works.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.