PHP
  Home arrow PHP arrow Retrieving Information on Selected Fil...
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

Retrieving Information on Selected Files with a PHP 5 File Uploader
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 2 stars2 stars2 stars2 stars2 stars / 3
    2008-03-26

    Table of Contents:
  • Retrieving Information on Selected Files with a PHP 5 File Uploader
  • Reintroducing a previous hands-on example
  • Retrieving useful information on the uploaded file
  • 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

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    Retrieving Information on Selected Files with a PHP 5 File Uploader
    (Page 1 of 4 )

    The initial script in the first tutorial of this series lacked some important features, such as the implementation of an effective error handling module and the ability to check the MIME type and size of the file being uploaded. In this second installment of the series, I’m going to improve the logic of the script from the first tutorial to provide it with the capacity to retrieve useful information concerning the entire file uploading process.

    As you know, nowadays the web has plenty of sites that provide visitors with the ability to easily upload their files to a web server. And this phenomenon, for bad or good, is a crucial part of the so-called “social web.” But regardless of what you may think of these kinds of websites, in all these cases, there’s a backend application that performs these file uploads via the HTTP protocol.

    However, there’s no need to build a huge social website to implement a file uploading mechanism. And you, as a PHP developer, are probably well aware of this. Handing file uploads with PHP is one of the most popular topics to learn these days, and that’s the reason I decided to write this article series. In its different tutorials, you’ll learn the basic concepts required to build a file uploading application with PHP 5, first by using a procedural approach and then via the object-oriented paradigm.

    Now that I've introduced you to the main subject of this group of articles, I’d like to quickly refresh the concepts that I deployed in the first part of the series, in case you didn’t have the chance to read it. In simple terms, I explained how to create a basic file uploading script in PHP 5 by using a combination of the “move_uploaded_file()” PHP native function and the $_FILES superglobal array.

    Naturally, first it was necessary to construct a simple front-end composed of a typical web form that provides users with an intuitive mechanism to browse files in the client machine, then select one of them, and finally upload it to the server via the aforementioned PHP script. However, this was only an introductory approach for building a file uploader with PHP 5.

    As you know, small moves can go a long way, so let’s continue learning how to handle file uploads with PHP 5. Let’s get going!

    More PHP Articles
    More By Alejandro Gervasio


       · In this second chapter of the series, you’ll learn how to use the $_FILES...
       · Great tutorial, iv being trying to develope this code to also include writing the...
       · Thank you for the kind comments on my PHP article. Now, regarding the code you...
     

       

    PHP ARTICLES

    - 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
    - Working with Multiple Document Nodes with th...




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