atticus Posted November 8, 2007 Share Posted November 8, 2007 I am trying to upload videos to the server with a form using php. The address of the video is stored in mysql. It is not functioning properly. It works fine for images, but is not uploading the videos. $uploadDir = 'upload/'; if(isset($_POST['upload'])) { $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $filePath = $uploadDir . $fileName; $result = move_uploaded_file($tmpName, $filePath); chmod($filePath, 0755); if (!$result) { echo "Error uploading file"; exit; } if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath = addslashes($filePath); } mysql_connect($db_host, $db_user, $db_pwd); mysql_select_db($db_name); $query = "INSERT INTO upload2 (name, size, type, path, title, description, buy, sort) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$filePath', '$_POST[title]', '$_POST[description]', '$_POST[buy]', '$_POST[sort]')"; mysql_query($query) or die('Error, query failed : ' . mysql_error()); any suggestions... Quote Link to comment Share on other sites More sharing options...
atticus Posted November 8, 2007 Author Share Posted November 8, 2007 I am adding this to my script: ini_set('post_max_size','500M');//Upload up to 500 Megabytes ini_set('upload_max_file_size','500M');//Upload up to 500 Megabytes Where is the best place to put it? 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.