jd2007 Posted August 14, 2007 Share Posted August 14, 2007 i'm doing this: if (file_exists($_FILES['filef']['name'])) { if (filesize($_FILES['filef']['size'])>=3000000) { echo "Flash is good !"; } else { echo "Flash too large"; } } else { echo "Flash doesn't exist"; $error=error_get_last(); echo $error['message']; echo $error['line']; } Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 14, 2007 Share Posted August 14, 2007 if (file_exists($_FILES['filef']['name'])) try using is_uploaded_file instead... which line are you getting the error on? Quote Link to comment Share on other sites More sharing options...
jd2007 Posted August 14, 2007 Author Share Posted August 14, 2007 this is the full code: <?php class FlashUploader { private $host; private $username; private $password; private $db; private $table; private $title; private $brief; private $main; private $checkboxes; private $flash; private $thumb; private $author; private $submitted; private $score; private $size; function connectdb($l, $u, $p, $d) { $this->host=$l; $this->username=$u; $this->password=$p; $this->db=$d; mysql_connect($this->host, $this->username, $this->password); mysql_select_db($this->db); } function getandsendDetails($ftitle, $fbrief, $fmain, $fcbx, $aut, $subm, $sc) { $this->checkboxes=explode("/", $fcbx); $this->que="insert into videos (title, brief, main, author, submitted, size) values ($this->title, $this->brief, $this->main, $this->author, $this->submitted, $this->size)"; $this->res=mysql_query($this->que); } function checkFiles($file, $thumbnail) { //$this->flash=$file; //$this->thumb=$thumbnail; if (file_exists($_FILES['filef']['name'])) { if (filesize($_FILES['filef']['size'])>=3000000) { echo "Flash is good !"; } else { echo "Flash too large"; } } else { echo "Flash doesn't exist"; $error=error_get_last(); echo $error['message']; echo $error['line']; } } function moveFiles() { move_uploaded_file($_FILES["filef"]["tmp_name"], "a/"); } } $flashupload=new FlashUploader; $flashupload->connectdb("localhost", "root", "*****", "videoportal"); $x=$flashupload->checkFiles('', ''); if ($x=="Flash is good !") { $flashupload->moveFiles($_FILES["filef"], $_FILES["file2f"]); if (!$flashupload->moveFiles($_FILES["filef"], $_FILES["file2f"])) { echo "File could not be uploaded"; } else { $flashupload->getandsendDetails($_POST["textfield4"], $_POST["textfield5"], $_POST["textfield52"], $_GET["arr"], "jd2007", "2", "0"); } } else { echo $x; } ?> line 42 Quote Link to comment Share on other sites More sharing options...
jd2007 Posted August 14, 2007 Author Share Posted August 14, 2007 i get the same error. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 14, 2007 Share Posted August 14, 2007 and what line is the error reported on??? Quote Link to comment Share on other sites More sharing options...
jd2007 Posted August 14, 2007 Author Share Posted August 14, 2007 42 Quote Link to comment Share on other sites More sharing options...
jd2007 Posted August 14, 2007 Author Share Posted August 14, 2007 pls help me...what can be wrong ? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 15, 2007 Share Posted August 15, 2007 may sound daft but is your <input type="image" got the name or id 'filef' ?? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.