Jump to content

Uploading video


benji87

Recommended Posts

Hey all im working on a script that allows a user to upload videos. Now i use the exact same script to upload images and it works perfectly and there is no file extension filtering in the script but for some reason when i try to upload a video it processes the file then says its a possible file attack. I think it may be because somehow it times out?? Could someone help me out? Thank

[code]<?
include 'db.php';
$imgname = ($_FILES['userfile']['name']);
$uploaddir = '../../video/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
$filename = basename($_FILES['userfile']['name']);

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
header ("Location: ../media.php");
} else {
  echo "Possible file upload attack!\n";
}
$sql = mysql_query("INSERT INTO ssrfc_videos(video)
VALUES('$filename')") or die (mysql_error());

if(!$sql){
echo 'There has been an error while trying to upload your image.';
} else {
$id = mysql_insert_id();
}
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/28853-uploading-video/
Share on other sites

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.