/    Sign up×
Community /Pin to ProfileBookmark

How can I ease/remove file size limitations in this script…?

Hello again, figured I’d come back for one more round of help since I passed my first hurdle thanks to this forum. ?

The following is 2/3 of a script (other 1/3 is just a general email script) that is making a directory dependent on the user’s input, and uploading files in to that directory. What I need help on this times is this: [i]what in the following script is capping off the file size?[/i]

[quote]

<?
$oldumask = umask(0);
mkdir(“../download/”.($_POST[‘dirName’]), 0777);
umask($oldumask);

$uploadNeed = $_POST[‘uploadNeed’];
// start for loop
for($x=0;$x<$uploadNeed;$x++){
$file_name = $_
FILES[‘uploadFile’. $x][‘name’];
// strip file_name of slashes
$file_name = stripslashes($file_name);
$file_name = str_replace(“‘”,””,$file_name);
$copy = copy($_FILES[‘uploadFile’. $x][‘tmp_name’],”../download/”.($_POST[‘dirName’]).”/”.$file_name);

// check if successfully copied
if($copy){
echo “The file $file_name has uploaded sucessfully!<br>”;
}else{
echo “<h1>The file $file_name could NOT be uploaded!</h1>”;
}
} // end of loop

print “<br><p><img src=’images/thankYouLogo.gif’></p><h1>What do you want to do now?</h1><p><a href=’upload1.php’>Make another upload?</a><br><a href=’../download/’>Or visit the download section?</a></p>”

?>

[/quote]

During testing, some users ran into size limitation issues, which simply caused the script to error out and, if applicable in the case of multiple file uplaods, only took the smaller files. I haven’t quite locked it down, but somewhere around 2 MBs it was getting finicky about size…

Is there something in this code that I’m not seeing that’s limiting size? If there isn’t what else could it be?

Thanks in advance for any help!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@SheldonSep 15.2005 — it will be in the 1/3rd you left out

some thing ike
[code=php]
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
[/code]
Copy linkTweet thisAlerts:
@Jonny123authorSep 15.2005 — I appreciate the input Sheldon... But I think I've narrowed it down actually.

The rest of that script [i]is[/i] simply just basic php email code...nothing about size or anything.

After some intensive searching, I found that my server's php.ini "upload_max_filesize" is set at 2MB. ?

Since I essentially rent space on this service with several friends, I wonder if I could get it changed without affecting everyone else? I'll have to look in to it...
×

Success!

Help @Jonny123 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...