Welcome Guest, Not a member yet? Register   Sign In
File Upload Problem
#1

[eluser]JamesTaylor[/eluser]
I have a file upload function on a website which has recently been built. Everything seems to work fine and a number items have been uploaded successfully to date.

However i now have a file which keeps returning the error:

'The uploaded file exceeds the maximum allowed size in your PHP configuration file.'

This seems strange to me as the file size is only 2.22mb and i have used the following config settings in my code:

Code:
$config['upload_path'] = 'Uploads/Club/';
$config['allowed_types'] = 'pdf|doc|jpg';
$config['max_size']    = '5000';
$config['max_width']  = '1024';
$config['max_height']  = '768';

I've also looked into the assigned limits of the hosting i use and they state that the default limit they implement is 5mb with a time out of 30 secs.

Everytime i attempt the upload it seems to take approx 35secs for the error message to be sent, so could this be a time out issue? but that wouldn't really fit with the error message?

Does anyone have any suggestions as to what may be the issue here?

Thanks

James
#2

[eluser]JoostV[/eluser]
The 'maximum allowed size in your PHP configuration file' is set in php.ini, regardless of what you set in $config['max_size'].

Open php.ini, search for upload_max_filesize and set its value higher than 2M.

If your keep having problems you may also have to adjust:
* max_input_time
* memory_limit
* max_execution_time
* post_max_size

Careful with the memory_limit and max_execution_time values!




Theme © iAndrew 2016 - Forum software by © MyBB