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
Share on other sites

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.