I need to have files uploaded upto say 20Mg. I have put this small test script together to simplify, and to try and solve this problem.
The test files I have been using are 4-6Mg... all other files, >2Mg work fine.
Any suggestions?
----------------------------------------------
<?php ini_set('upload_max_filesize','20M'); ?>
<html>
<head>
<body>
<form enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="20000000">
File: <input name="userfile" type="file" /><br />
<input type="submit" value="Upload" />
</form>
<?php
if (@is_uploaded_file($_FILES["userfile"]["tmp_name"])) {
copy($_FILES["userfile"]["tmp_name"], "files/" . $_FILES["userfile"]["name"]);
echo "<p>File uploaded successfully.</p>";
}
?>
</body></html>
-----------------------------------
Thanks,
James
Problem with uploading large files - over 2mg
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You need to change the upload_max_filesize in the php.ini, ini_set() will have no effect on it because the file's already been passed to PHP before the ini setting is changed.
http://php.net/ini_set
Mac
http://php.net/ini_set
Mac
Found you can alter the php.ini values in the .htaccess in the root directory... got it over 2Mg, but now Ive hit the hurdle of 8Mg.
ini_set('upload_max_filesize','50M');
ini_set('post_max_size','55M');
ini_set('max_execution_time','60');
ini_set('memory_limit','50M');
I have tried the above values in the .htaccess as well... but still not able to get over 8Mg.
Any ideas?
Thanks, James
ini_set('upload_max_filesize','50M');
ini_set('post_max_size','55M');
ini_set('max_execution_time','60');
ini_set('memory_limit','50M');
I have tried the above values in the .htaccess as well... but still not able to get over 8Mg.
Any ideas?
Thanks, James