File Uploading with PHP Support Product Page

This topic was archived

Missing code in PDF

Asked 13 Dec 2003 22:33:47
1
has this question
13 Dec 2003 22:33:47 sharky barky posted:
I cut and paste this from the PDF but obviously there is stuff missing.

<?php
if($_POST['action'] == "upload"{
$uploadDirectory = "./";
# Check Upload Directory Exists
if(!file_exists($uploadDirectory)){
if(!mkdir($uploadDirectory,0777)){
die ("User upload directory could not be created";
}
}
for($i=1;$i <= 3; $i++){
$currentImage = "image" . $i;
if(str$tempFile = $_FILES[$currentImage]['tmp_name'];
$originalName = $_FILES[$currentImage]['name'];
$newPath = $uploadDirectory . $originalName;
if(@move_uploaded_file($tempFile,$newPath) === "FALSE"{
die("File image " . $i . " could not be written";
}
}
}
}
?>

Edited by - sharkybarky on 13 Dec 2003 22:43:46

Replies

Replied 14 Dec 2003 07:13:56
14 Dec 2003 07:13:56 Gareth Downes-Powell replied:
I`ve put the code from the article online for download at:

www.garethdp.com/writing/articles/dmxzone/code/fileuploads/

Reply to this topic