I have the following php script
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
if (file_exists("upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
}
}
?>
can anyone help allow it to upload pdf files larger than around 100 Kb?
I have checked with my hosting provider and everything is correct there, I have also checked phpinfo() which states that uploads to 8 Mb should be allowed
Can anyone help point me in the right direction to fix this, my hosting provider suggested I create a php.ini file, but want commands does it need to contain to allow uploading?
Thanks for your help
Here is a small tips for you which you can use to upload such a large file using file field of the form and move_uploaded_file() function in PHP.
1) Create a .htaccess file in the root folder of web server.
2) Put the following code in side the .htaccess file and save it.
Now you can upload the file-size up-to 8MB in a simple way using file field in your html form and move_uploaded_file() function available in PHP.