Home arrow PHP arrow Retrieving Information on Selected Files with a PHP 5 File Uploader

Retrieving Information on Selected Files with a PHP 5 File Uploader

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.

TABLE OF CONTENTS:
  1. Retrieving Information on Selected Files with a PHP 5 File Uploader
  2. Reintroducing a previous hands-on example
  3. Retrieving useful information on the uploaded file
  4. Listing the complete source code of the improved file uploading application
By: Alejandro Gervasio
Rating: starstarstarstarstar / 6
March 26, 2008

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: