SiteMinder / Webhosting
The Computer Merchant, Ltd
US-MA-North Quincy

Justtechjobs.com Post A Job | Post A Resume

File Version Management in PHP
Program Plan

I drafted a plan on what is needed for this file version management program. Below are some features planned:

  1. When a user uploads a file for the first time, the system should upload the file in the specified folder and insert the file details like file name, size, type in the database table.
  2. When the user uploads a file for the second time (the filename has to be the same), the system will compare the size, date and time of existing file and file being uploaded, and automatically assign a new version for the uploaded file if there is a difference. If there is no difference, then the existing file will be retained and a message will be displayed for the user.
  3. A check box allows the user to replace the existing file. Clicking this option will replace the existing file. Note that only the latest version of the file can be replaced in this case, and not an older one.
  4. The database will maintain file list and version details. User should be able to view all the versions of a file and download the required version.
  5. While displaying the file list, the program displays all the versions of file under one name. For example, if the file name is xyz.doc and its other versions are xyz_VERSION1.doc, xyz_VERSION2.doc, xyz_VERSION3.doc, xyz_VERSION4.doc, xyz_VERSION5.doc and so on. The program will display filename as xyz.doc for all the versions.
  6. The program allows user to delete the file. Clicking on delete will ask for confirmation before proceeding.

The file manager program is designed to upload and manage files. The files are stored in a predefined folder. There are two files: file_upload_manager.php and file_display_manager.php, which performs the file operations. The former handles the file uploading and the later displays the file in the folder and also lets the user to delete the file. The source code is tested on Windows systems. Linux users, please change the folder path accordingly.

Database Design

Database name: upload

CREATE TABLE file_manager (
  file_id mediumint(9) NOT NULL auto_increment,
  file_name varchar(50) default NULL,
  file_type varchar(20) NOT NULL default '',
  file_size varchar(20) NOT NULL default '',
  file_modified varchar(20) NOT NULL default '',
  file_parent_id mediumint(9) default NULL,
  file_image_name varchar(50) default NULL,
  PRIMARY KEY  (file_id),
  KEY file_name (file_name),
  KEY file_image_name (file_image_name)
) TYPE=MyISAM;

 
Next Page

[Page 1]  [Page 2]  


Comments:
RE: upload & download files in PHPgaurav05/27/07 09:32
RE: Uploading Filessunny12/13/05 19:15
upload & download files in PHPkarthik06/21/05 03:03
Uploading FilesEdel05/31/05 13:38
upload & download files in PHPsneha04/29/05 03:56
uploading file and viewingsundaravadivel01/20/05 23:39
The scripts doesn't workIna12/08/04 00:36
ummmmmmmmm whats this mummy??Sex Beplaced Ru 12/07/04 09:37
A little suggestion.opryshok03/31/04 04:47
think, this is the right wayOlli02/19/04 11:31
Its Printable view is not displayed correctlySaid Bakr01/15/04 01:46
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.