Upload Limit (Size) HELP!

All support enquiries for other DaddyScripts' scripts go in here...

Upload Limit (Size) HELP!

Postby 333222333 » Thu Nov 17, 2011 4:53 am

Hello. i need help with this please...... when im uploading more then 120 MB it says you exceeded the limit...

here is the script, i dont know how to change the limit ... PLEASE HELP!!!


Script:


<?php


include("./config.php");
include("./header.php");

$filename = $_FILES['upfile']['name'];
$filesize = $_FILES['upfile']['size'];
$filecrc = md5_file($_FILES['upfile']['tmp_name']);

$bans=file("./bans.txt");
foreach($bans as $line)
{
if ($line==$filecrc."\n"){
echo "That file is not allowed to be uploaded.";
include("./footer.php");
die();
}
if ($line==$_SERVER['REMOTE_ADDR']."\n"){
echo "You are not allowed to upload files.";
include("./footer.php");
die();
}
}

$checkfiles=file("./files.txt");
foreach($checkfiles as $line)
{
$thisline = explode('|', $line);
if ($thisline[0]==$filecrc){
echo "That file has already been uploaded.<br />";
echo "Your download link is: <a href=\"" . $scripturl . "download.php?file=" . $filecrc . "\">". $scripturl . "download.php?file=" . $filecrc . "</a><br />";
echo "This file was originally uploaded by someone else, so you don't get a delete link.";
include("./footer.php");
die();
}
}

if(isset($allowedtypes)){
$allowed = 0;
foreach($allowedtypes as $ext) {
if(substr($filename, (0 - (strlen($ext)+1) )) == ".".$ext)
$allowed = 1;
}
if($allowed==0) {
echo "That file type is not allowed to be uploaded.";
include("./footer.php");
die();
}
}

if(isset($categorylist)){
$validcat = 0;
foreach($categories as $cat) {
if($_POST['category']==$cat || $_POST['category'] = ""){ $validcat = 1; }
}
if($validcat==0) {
echo "Invalid category was chosen..";
include("./footer.php");
die();
}
$cat = $_POST['category'];
} else { $cat = ""; }

if($filesize==0) {
echo "You didn't pick a file to upload.";
include("./footer.php");
die();
}

$filesize = $filesize / 1048576;

if($filesize > $maxfilesize) {
echo "The file you uploaded is too large.";
include("./footer.php");
die();
}

$userip = $_SERVER['REMOTE_ADDR'];
$time = time();

if($filesize > $nolimitsize) {

$uploaders = fopen("./uploaders.txt","r+");
flock($uploaders,2);
while (!feof($uploaders)) {
$user[] = chop(fgets($uploaders,65536));
}
fseek($uploaders,0,SEEK_SET);
ftruncate($uploaders,0);
foreach ($user as $line) {
@list($savedip,$savedtime) = explode("|",$line);
if ($savedip == $userip) {
if ($time < $savedtime + ($uploadtimelimit*60)) {
echo "You're trying to upload again too soon!";
include("./footer.php");
die();
}
}
if ($time < $savedtime + ($uploadtimelimit*60)) {
fputs($uploaders,"$savedip|$savedtime\n");
}
}
fputs($uploaders,"$userip|$time\n");

}

$passkey = rand(100000, 999999);

if($emailoption && isset($_POST['myemail']) && $_POST['myemail']!="") {
$uploadmsg = "Your file (".$filename.") was uploaded.\n Your download link is: ". $scripturl . "download.php?file=" . $filecrc . "\n Your delete link is: ". $scripturl . "download.php?file=" . $filecrc . "&del=" . $passkey . "\n Thank you for using our service!";
mail($_POST['myemail'],"Your Uploaded File",$uploadmsg,"From: admin@yoursite.com\n");
}

if($passwordoption && isset($_POST['pprotect'])) {
$passwerd = md5($_POST['pprotect']);
} else { $passwerd = md5(""); }

if($descriptionoption && isset($_POST['descr'])) {
$description = strip_tags($_POST['descr']);
} else { $description = ""; }

$filelist = fopen("./files.txt","a+");
fwrite($filelist, $filecrc ."|". basename($_FILES['upfile']['name']) ."|". $passkey ."|". $userip ."|". $time."|0|".$description."|".$passwerd."|".$cat."|\n");

$movefile = "./storage/" . $filecrc;
move_uploaded_file($_FILES['upfile']['tmp_name'], $movefile);

echo "Your file was uploaded!<br />";
echo "Your download link is: <a href=\"" . $scripturl . "download.php?file=" . $filecrc . "\">". $scripturl . "download.php?file=" . $filecrc . "</a><br />";
echo "Your delete link is: <a href=\"" . $scripturl . "download.php?file=" . $filecrc . "&del=" . $passkey . "\">". $scripturl . "download.php?file=" . $filecrc . "&del=" . $passkey . "</a><br />";
echo "Please remember these links.";
include("./footer.php");
?>
333222333
Newbie Member
 
Posts: 3
Joined: Thu Nov 17, 2011 3:48 am

Re: Upload Limit (Size) HELP!

Postby SamEA » Thu Nov 17, 2011 9:16 pm

Change the limit via the SettingsCP e.g. yourdomain.com/dfh/settings.php
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm


Return to Other DS Scripts!

Who is online

Users browsing this forum: No registered users and 2 guests

cron