Hi Daniwebteam,

I want to upload a file size which is greater than 2 MB.The default file size of php is 2MB.
So,i have used the following coding,

ini_set('upload_max_filesize','7M');

or
ini_set('upload_max_filesize','7000');


But still i did not able to upload a file size which is greater than 2mb.When i change the settings of ini.php file max_upload_filesize to 7MB then its fine.But i do not want to change the settings in ini.php file.I want to change the setting to my application only.Is there any steps to change this settings.


Thank you,

With Regards,
Prem

Recommended Answers

All 5 Replies

It's possible that it has been disabled. There are two other approaches that you can use to make a local change without making it global:

You may be able to use a local php.ini file in the same directory as the program doing the upload (I can do this on my virtual server).

You can use a .htaccess file:
php_value post_max_size 7M
php_value upload_max_filesize 7M

Thank for your reply,

How to use a .htaccess file.I do no about this htaccess file.


With Regards,
Prem

Hey,

Just create a file named .htaccess i your current file's root folder and place the code mentioned by chrishea in it.
Simple....

First of All, thank you very much that you shared with us. I don't have enough information how to upload the image or videos.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.