Login  |  Register
PHP3000.com  - Article Details
STATISTICS
  • Active Links: 4383
  • Pending Links: 5
  • Todays Links: 0
  • Total Articles: 4
  • Total Categories: 43
  • Sub Categories: 0

search engine - best results

Monitoring File Uploads using Ajax and PHP

Date Added: July 26, 2008 05:57:02 PM
Author: Quentin Zervass
Category:

Because of the limitations of HTTP, it is difficult to monitor the status of files as they are uploaded via HTML forms. While other programming languages have built-in methods to monitor file uploads, PHP does not. This article shows how to implement such a solution in PHP.

In order to achieve this, the APC (Alternative PHP Cache) PHP extension is required, as well as PHP 5. Specifically, APC 3.0.13 or newer and PHP 5.2 or newer are required for the code in this article to work. We will cover installation of APC in the next section. It is assumed you already have a working PHP 5.2 installation.

In this article we will develop a solution that will allow users to upload a file from their computer using HTML forms. We will then determine the progress of the upload while it is in progress using Ajax, and display the status to the user.

In addition to using PHP, we will also be using the Prototype JavaScript library (version 1.6.0), which you can download for free from http://www.prototypejs.org.

The steps we will follow in this article are as follows:

  • Installation of the APC extension for PHP.
  • How to monitor uploads using APC.
  • Creating a PHP class to manage file uploads.
  • Implementing a traditional file uploader.
  • Extending the uploader to display upload status.
Ratings
You must be logged in to leave a rating.
Average rating: (0 votes)
Comments

No Comments Yet.


You must be logged in to leave a Comment.
ARTICLES
Rasmus Lerdorf at OSCON: Getting Rich with PHP 5
Rasmus Lerdorf gave a talk on “Getting Rich with PHP 5”. He showed techniques to dramatically improve the throughput of a web application. Click [ more ] and I’ll give you the details.
Creating A Fulltext Search Engine In PHP 5 With The Zend Framework's Zend Search Lucene
This article covers the implementation of a fulltext search engine using PHP 5 and the Zend Framework. We will be using the Zend_Search_Lucene component to create and search our fulltext index.
Monitoring File Uploads using Ajax and PHP
Because of the limitations of HTTP, it is difficult to monitor the status of files as they are uploaded via HTML forms. While other programming languages have built-in methods to monitor file uploads, PHP does not. This article shows how to implement such a solution in PHP. We will use Ajax to retrieve information about a file as it is being uploaded and display the progress back to the user.
Generating Static Images of Google Maps
One useful feature of Google Maps is the ability to generate a static image of any longitude and latitude that you desire, as opposed to using the normal JavaScript-based interactive map. In this article I will show you how to request such static images. We will then combine this technique with the geocoder we created in the article Geocoding with PHP and the Google Maps API.