File: index.php

Recommend this page to a friend!
  Classes of Jannerel Roche  >  PHP Simple Upload  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: sample usage php file
Class: PHP Simple Upload
Process files for upload and download
Author: By
Last change:
Date: 11 years ago
Size: 1,244 bytes


Class file image Download

(MAX_FILE_SIZE, 1000000);


$err = '';

$_REQUEST['submit'])) {
$postname = 'upload';
$uploaddir = 'uploads';
$validext = array("application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document","image/gif","image/pjpeg", "image/jpg","image/jpeg", "image/png");
$newupload = new CLS_UPLOAD($postname, $uploaddir, '', $validext); //default accepted file extension is file, unless image is specified
if($res = $newupload->setUpload()) {$fileup = $newupload->getNewFileN(); $newupload->converttohtml(); }

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<form method="post" enctype="multipart/form-data" >
<input type="hidden" name="MAX_FILE_SIZE" value="<?=MAX_FILE_SIZE?>" />
<input type="file" name="upload" />
<input type="submit" name="submit" value="submit" />

For more information send a message to info at phpclasses dot org.