Blog

PHP Uploading & .htaccess

15.12.2009

POSTED IN Blog, PHP | NO COMMENTS TAGS : ,

For the senior developers, this is common knowledge in your tool box. For others, it can be quite a hassle to get your app working. Throw in some GoDaddy or similiar hosting service and you’ve got a nightmare.

Here are a couple examples to help you with uploading in PHP..

Open your .htaccess file or create one in a txt editor now. Add the below to the bottom of your .htaccess:

php_value upload_max_filesize 20M  //Add your max upload size here
php_value post_max_size 20M //this sets the filesize limit while using POST in your form

For those of you with sluggish servers, shared hosting or large files, it may benefit you to up the maximum execution time so that the upload doesn’t timeout during the process

php_value max_execution_time 200
php_value max_input_time 200

That’s a wrap, there are plenty of other resources available on php and .htaccess, just google it.

This is the start of what is going to be a small series on developing a modern approach to managing FileZilla through an API.  Primarily, I will develop in PHP and will eventually port the code into Ruby.

It really is a work in progress and my primary goal is to get it to a point where I can manage users through an API.  I chose XML to start with and will also port into JSON at a later time. It is important to note that while I prefer the *nix system, I needed to set this up on a MS box, not that I wanted to, believe me. The code is so rough it is bound to have some issues, if you see anything worth noting, please point it out!

Also, this work is to be released under the GPL so please feel free to use it as you like and give credit where credit is due.
Read more »

Hey Johnny, What Gives?

Sorry friend! I am not available at the moment, I'm busy making history. Be sure to shoot me a note so I can pencil you in, seriously :)

Little About Me

ABOUT

Livin' Large Since ....'81

oDesk Certified!

The On Demand Global Workforce - oDesk

Powered By

Cloud Computing

Categories