Hi Larry,
I have a problem trying to upload a pdf file. I get the following error message:
An error occurred in script '/mnt/vol3/home/b/e/bexcom/public_html/e-Commerce/kip/add_pdf.php' on line 52:
move_uploaded_file(www.bexcomputersdesigns.co.uk/e-Commerce/pdfs/bd42c707f6a002d4abd8993fa08236eb5ca84e6a_tmp) [function.move-uploaded-file]: failed to open stream: No such file or directory
This is the section (including the line numbers for reference) from the add_pdf.php file:
46 // If no errors, create file's new name and destination
47 if (!array_key_exists ('pdf', $add_pdf_errors)) {
48 $tmp_name = sha1 ($file['name'] . uniqid ('', true));
49 $dest = PDFS_DIR . $tmp_name . '_tmp';
50
51 // Move the file
52 if (move_uploaded_file ($file['tmp_name'], $dest)) {
53 $_SESSION['pdf']['tmp_name'] = $tmp_name;
54 $_SESSION['pdf']['size'] = $size;
55 $_SESSION['pdf']['file_name'] = $file['name'];
56 echo '<h4>
57 The file has been uploaded!
58 </h4>';
59 } else {
60 trigger_error ('The file could not be moved.');
61 unlink ($file['tmp_name']);
62 }
63 } // End of array_key_exists() IF.
This is how I have set up the paths in my config.inc.php file:
define ('BASE_URI','www.bexcomputersdesigns.co.uk/e-Commerce/');
define ('BASE_URL','www.bexcomputersdesigns.co.uk/');
define ('MYSQL','includes/mysql.inc.php');
define ('PDFS_DIR',BASE_URI . 'pdfs/');
All my files are within a folder called kip which this is within a folder called e-Commerce. I have placed the pdfs folder within the e-Commerce folder so it was outside the root directory.
Hope this information helps.