I have a little uploadscript which is working great for normal sized images and files.
function uploadimage($name,$dir)
{
if($name['error'] > 0){
die('An error ocurred when uploading.');
}
if(!getimagesize($name['tmp_name'])){
die('Please ensure you are uploading an image.');
}
// Check filetype
if($name['type'] != 'image/png'){
die('Unsupported filetype uploaded.');
}
// Check filesize
if($name['size'] > 500000){
die('File uploaded exceeds maximum upload size.');
}
// Check if the file exists
if(file_exists($dir. $name['name'])){
die('File with that name already exists.');
}
// Upload file
if(!move_uploaded_file($name['tmp_name'], $dir. $name['name'])){
die('Error uploading file - check destination is writeable.');
}
return $dir. $name['name'];
die('File uploaded successfully.');
}
$name is $_FILES[‘WHATEVER’] and $dir the dir. Well now I just changed a few lines of it to upload .csv files with it. So far so good. It’s working with little .csv files. But when I try a bigger one (20MB+) nothing happens when I post it. I checked my php.ini for upload_max_filesize and memory_limit , both are at 128M … Someone can give me a pointer where I should search the bug ?
Take a look at
post_max_sizetoo.