Home arrow PHP arrow Developing a Modular Class For a PHP File Uploader

Developing a Modular Class For a PHP File Uploader

If you’re a PHP programmer who needs to learn the basic concepts surrounding the implementation of file uploads via the HTTP protocol, then look no further, because you’ve come to the right place. Welcome to the final installment of the series “Building file uploaders with PHP 5.” In a step-by-step process, this series teaches you how to build several PHP-driven file uploading applications by using not only a procedural approach, but the object-oriented paradigm as well.

TABLE OF CONTENTS:
  1. Developing a Modular Class For a PHP File Uploader
  2. Handling file uploads using the object-oriented paradigm
  3. Completing the definition of the FileUploader class
  4. Testing the FileUploader class
By: Alejandro Gervasio
Rating: starstarstarstarstar / 3
April 16, 2008

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Now that you’re aware of the topic that's covered by this series of articles, it’s time to refresh what was discussed in the last tutorial. As you’ll probably recall, during that particular part of the series, I went through the development of a custom PHP function, called “uploadFile()”, which, as its name implies, came in handy for uploading a selected file to a web server via a simple web form.

Apart from performing the file uploading process itself, the aforementioned PHP function was provided with the capacity to throw exceptions in response to different errors that might arise when a file is being uploaded to the web server. In this way, it implements a basic, yet effective, error handling mechanism.

So far, so good. At this stage, you've hopefully recalled how to build an expandable file uploading application with PHP 5 that uses only one custom function to transfer a target file from a client machine to a predefined web server. However, in the beginning, I said that I was going to teach you how to develop a brand new file uploading application using an object-oriented approach.

Therefore, this last part of the series will be entirely focused on building a highly modular PHP 5 class. It will encapsulate all the business logic required to perform file uploads via HTTP behind its API.

So, let’s not waste more time in preliminaries and start learning how to create a file uploading class 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: