News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
File Uploads with PHP
September 26, 2011 @ 11:42:40

SitePoint's PHPMaster.com site has a new tutorial today from Timothy Boronczky about handling file uploads in PHP. It's a pretty low-level introduction and is perfect for those new to PHP.

What do pictures in an online photo album, email attachments in a web-based mail client, and data files submitted to an online application for batch processing all have in common? They all rely on the ability to upload files across the Internet from the user's web browser. Indeed, uploading files is an important feature of many of the sites and web-based applications we use on a daily basis. In this post, I show you how to add support for file uploads to your site using PHP.

He starts with the changes you might need to make to your php.ini configuration file (for allowing uploads and setting a temporary directory) and a basic "form" tag with the necessary "enctype" setting. The sample form includes a "file" type field that submits the file data to a waiting PHP script on the backend. The script looks for the submit (in the $_FILES superglobal) and, after doing some filtering on the name and content type, moves it to a new directory.

0 comments voice your opinion now!
file upload tutorial introduction security contenttype filter


blog comments powered by Disqus

Similar Posts

Invoke Media Blog: Zend Framework and Rapid Application Development with PHP

Brian Swan's Blog: Accessing Windows Azure Queues from PHP

Pádraic Brady's Blog: Automatic Output Escaping In PHP & The Real Future Of Preventing XSS

PHPMaster.com: REST - Can You do More than Spell It? Part 4

Lorna Mitchell: Using Phing with Travis CI


Community Events





Don't see your event here?
Let us know!


code list release introduction library community framework api configure project application bugfix wordpress threedevsandamaybe podcast series developer interview language laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework