#native_company# #native_desc#

File Version Management in PHP

By M. Murali Dharan
on January 14, 2004


We can find many articles related to file upload, view, download, etc. This article is written on this basic concept of uploading and managing files. File upload is a process of copying the file from your machine to the remote server. Other users of the system then share this file by viewing / downloading. What happens when I upload a file that already exists in the remote folder to which you are uploading? While discussing this problem, various other issues arises, such as:

  • Should the program allow the user to restore this file or retain the existing file?
  • If the file exists, then should I copy the file as a new version?
  • How do I manage files if the user uploads files of same name and type more than once?

This article gives you a solution for all the above problems and also I hope this article will be useful for you to integrate in your projects.

This article is developed with the following versions of Apache, PHP and MySQL:

  • Apache – 1.3.23
  • MySQL – 3.23.48
  • PHP – 4.1.1

Operating System: Windows Professional


To understand this article, you should have a fair knowledge of PHP. To run examples given in your machine, you need Apache, PHP, and MySQL software installed and configured.