PHP
  Home arrow PHP arrow Creating an Error Handling Module for ...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
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: 5 stars5 stars5 stars5 stars5 stars / 1
    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:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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

    Route your faxes to your email inbox. Private, secure fax numbers available from CallWave. Choose your fax number.

    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


       · File uploads, as other tasks performed by users, require to check input data....
     

       

    PHP ARTICLES

    - Setting Up a Web-based Image Hosting Service
    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery
    - Using Timers to Benchmark PHP Applications
    - Benchmarking Applications with PHP
    - Setting Up a Web-Based File Manager: PHPfile...
    - Developing a Modular Class For a PHP File Up...
    - Setting Up a Web-Based File Manager: bfExplo...
    - Defining a Custom Function for File Uploader...
    - Parsing Child Nodes with the DOM XML extensi...
    - Creating an Error Handling Module for a PHP ...
    - Accessing Attributes and Cloning Nodes with ...
    - Retrieving Information on Selected Files wit...
    - Handling HTML Strings and Files with the DOM...
    - Building File Uploaders with PHP 5

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway