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... Link to comment https://forums.phpfreaks.com/topic/76548-video-upload-with-php/ 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? Link to comment https://forums.phpfreaks.com/topic/76548-video-upload-with-php/#findComment-387689 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.