PHP
  Home arrow PHP arrow Creating an Error Handling Module for a PHP 5 File Uploader
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Creating an Error Handling Module for a PHP 5 File Uploader
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 2
    2008-04-02


    Table of Contents:
  • Creating an Error Handling Module for a PHP 5 File Uploader
  • Performing file uploads without checking errors
  • Creating an effective error handling module
  • Listing the complete source code of the improved file uploading application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Creating an Error Handling Module for a PHP 5 File Uploader
    ( Page 1 of 4 )

    Welcome to the third chapter of the series “Building file uploaders with PHP 5.” Comprised of five approachable tutorials, this series teaches you the fundamentals of constructing file uploading applications with PHP 5. It also complements the corresponding theoretical concepts with numerous hands-on examples. In this third tutorial of the series, I’m going to show you how to incorporate a brand new error checking module into the file uploading PHP script created in the last article.

    As with many other topics related to the development of modern web applications, PHP makes file uploading a no-brainer process, even for those programmers who are just starting to familiarize themselves with the basics of this popular language. Fortunately, the intrinsic flexibility of PHP permits us to build file uploading applications using a procedural approach and the object-oriented paradigm. Thus, if you're interested in learning how to implement file uploads by way of a few simple functions and classes, then don't waste more time and start reading this article series now!

    Now that you're familiar with the goal of this article series, I'd like to spend a few moments rehashing the topics that were treated in the last article, in case you haven't the chance to read it. In simple terms, I explained how to build a rudimentary file uploading application that was given the ability to display useful information about an uploaded file, including its MIME type and size expressed in bytes, and its temporary name and client names as well.

    This capacity was introduced into the script in question via the $_FILES super global array, which provides detailed information on each file uploading process performed with PHP. However, it's fair to highlight an important point regarding the use of this array: it also includes a handy element that stores different error codes when a file has been uploaded to the web server. As you may have guessed, it's possible to use this set of error numbers to implement an efficient error handling module that keeps track of the different failures that might occur during a specific file upload.

    It's time to dispose of the preliminaries and learn how to create the aforementioned error processing module in a few easy steps. Let's go!



     
     
    >>> More PHP Articles          >>> More By Alejandro Gervasio
     

       

    PHP ARTICLES

    - Using Directory Iterators to Build Loader Ap...
    - Using the spl_autoload() Functions to Build ...
    - Working Out of the Object Context to Build L...
    - Using the _autoload() Magic Function to Buil...
    - The Destruct Magic Function in PHP 5
    - The Autoload Magic Function in PHP 5
    - Developing a Recursive Loading Class for Loa...
    - The Sleep and Wakeup Magic Functions in PHP 5
    - Using the Clone Magic Function in PHP 5
    - Including Files Recursively with Loader Appl...
    - The Call Magic Function in PHP 5
    - Designing a Captcha System with PHP and MySQL
    - Using Static Methods to Build Loader Apps in...
    - The Isset and Unset Magic Functions in PHP 5
    - Advanced PHP Form Input Validation to Check ...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT