Increasing File Upload Limit Using .htaccess

As PHP limits maximal file upload into 2 (two) megabytes, sometimes we need to increase the value to upload bigger files.

Editing php.ini is the easiest way, but it is impossible when our scripts are in a shared hosting. The only few choice is by using .htaccess file. It will rewrite php.ini’s configuration.

I’ve tried this method and worked as I expected: Here’s the .htaccess content:

RewriteEngine On
php_value upload_max_filesize 30M

Last words, there’s manything we can do using .htaccess to overide server’s default configuration ^_*

 

6 Responses to “Increasing File Upload Limit Using .htaccess”

  1. kiyat Says:

    Good tricks :D, udah aku praktekin.. tp lum tau cara buktiin nya :D

    Nanya Jeng. kalo kita mau file php nya di namakan *.pas tapi tetep bisa di execute as php gimana?
    aku lihat di salah satu web, dia pake extension .pas di semua file php nya.

  2. linoxs Says:

    Duh, so last year bgt sih tutorialnya. Hehheheee…

    @starboard,
    tambahin ini jeng,
    AddType application/x-httpd-php .pas .linoxs

    Soal saya baru ngalamin hari ini he.he.he

  3. kiyat Says:

    di kasih dimana jeng linoxs?
    di bawah sendiri bisa?

    Jeng Yeni, commentnya buawat diskusi :D

  4. agung Says:

    selama ga ada kata “admin” nya, setting php.ini bisa di override ( + php jalan sbg module apache :P ).

    @kiyat a.k.a starboard
    di .htaccess ? bisa aja jeng.

    http://id2.php.net/configuration.changes

  5. ronggur Says:

    gua..kalo cuma buat sendiri mah mending pake http://ftp..kenapa? gila aja ngupload file yang gedenya ampe belasan MB liwat script PHP..bisa2timeout server gue :p

  6. kiyat Says:

    Jeng, punya script php yang buat upload zip trus dia bisa de-compress otomatis gak?

    aku biasanya upload pake web2ftp.com cuman skg dia deactive :(

    padahal enak klo upload file pake itu, tinggal di zip dah decompress otomatis. :)

Leave a Reply