edot Posted November 8, 2009 Share Posted November 8, 2009 Hi Guys I am creating a site and i want users to be able to upload videos to a folder on a server, using SQL to store the path of the video and the name. I have created this Code. And it does upload all the details, but does not upload the video itself... <? session_start(); require("connection.php"); $title = mysql_real_escape_string($_POST['title']); $date = mysql_real_escape_string($_POST['date']); $author = mysql_real_escape_string($_POST['author']); $type = mysql_real_escape_string($_POST['type']); $description = mysql_real_escape_string($_POST['description']); $vidName = $_FILES['vid']['name']; $vidTmp = $_FILES['vid']['tmp_name']; $vidSize = $_FILES['vid']['size']; $maxFileSize = 2000000; $filePath = "uploads/videos/".$vidName; move_uploaded_file($imgTmp, $filePath); $query = sprintf("INSERT INTO videos(title, date, author, description, type, vid) VALUES ('%s', '%s', '%s', '%s', '%s', '%s')", $title, $date, $author, $description, $type, $filePath); if(!mysql_query($query, $connect)) { die(mysql_error()); } else { echo("Choose a video!"); } ?> Can anybody tell me where im going wrong or give me some advice? Thanks, Evan Link to comment https://forums.phpfreaks.com/topic/180797-php-mysql-upload-videos-to-remote-folder/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.