Re: Video Uploads

From: Date: Tue, 09 Nov 2004 17:24:03 +0000
Subject: Re: Video Uploads
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-201634@lists.php.net to get a copy of this message
The video is 1.5 meg and yes I can upload a PSD file that is 1.8.. Jay Minuk Choi wrote:
How big are the video files(byte wise)? Have you tried uploading a non-video file of the same size? ----- Original Message ----- From: "Jay Fitzgerald" <jayfitz@bayou.com> To: <php-general@lists.php.net> Sent: Tuesday, November 09, 2004 12:10 PM Subject: [PHP] Video Uploads
I can upload just about everything with this script; but I don't understand why it says that the videos i try to upload are zero length. ------------------------------ THE FORM ------------------------------ <form method="post" name="info" enctype="multipart/form-data" id="x-form" action="add.php"> <input type="hidden" name="max_size" value="51200000"> <input type="file" name="form_data"> <input type="submit" name="submit" value="Add Video"></form> ------------------------------ THE SCRIPT ------------------------------ ini_set ('display_errors', '1'); ini_set ('error_reporting', E_ALL); if (empty($_POST['submit'])) { include ('addform.php'); } else { $path = '/home/mydir/public_html/news/videos/'.$_FILES['form_data']['name']; $url = 'http://www.mysite.com/news/videos/'; $_POST = array_merge($_POST, $_FILES); if (!empty($_FILES['form_data']['name'])) {
       if ($_FILES['form_data']['size'] == 0)
       {
           echo 'Problem: '.$_FILES['form_data']['name'].' is zero length';
       }
       if ($_FILES['form_data']['size'] > $_POST['max_size'])
       {
           echo 'Problem: '.$_FILES['form_data']['name'].' is over '.$_POST['max_size'].' bytes.';
       }
       if (!is_uploaded_file($_FILES['form_data']['tmp_name']))
       {
           echo $_FILES['form_data']['name'].' is not uploaded.';
       }
       move_uploaded_file($_FILES['form_data']['tmp_name'], $path);
} } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#201634) next »