Forum Moderators: coopster
I have checked the permissions on both folders (php_tmp_dir and the actuall path I intended to upload that file.
Both directories have read and write access.
Even if i try to get it's value using echo, $_FILES['classnotes']['tmp_name'] browser doesn't display anything.
I have checked the php_tmp_dir, there is no uploaded file there.
Please HELP !
PHP Version 5.2.6
Code:
=====
<form action="<?php print $PHP_SELF?>" enctype="multipart/form-data" method="post">
Last Name:<br /> <input type="text" name="name" value="" /><br />
Class Notes:<br /> <input type="file" name="classnotes" value="" /><br />
<p><input type="submit" name="submit" value="Submit Notes" /></p>
</form>
<?php
define ("FILEREPOSITORY","./");
if (is_uploaded_file($_FILES['classnotes']['tmp_name'])) {
if ($_FILES['classnotes']['type'] != "application/pdf") {
echo "<p>Class notes must be uploaded in PDF format.</p>";
} else {
$name = $_POST['name'];
$result = move_uploaded_file($_FILES['classnotes']['tmp_name'], FILEREPOSITORY."/$name.pdf");
if ($result == 1) echo "<p>File successfully uploaded.</p>";
else echo "<p>There was a problem uploading the file.</p>";
} #endIF
} #endIF
?>
[edited by: adnanqureshi at 7:34 pm (utc) on Aug. 19, 2008]
============================
Still I am getting Error 6 - Missing a temporary folder. Introduced in PHP 4.3.10 and PHP 5.0.3
============================
Following is the result of print_r($_FILES);
Array ( [classnotes] => Array (
[name] => CMS_FDS_v1.pdf
[type] =>
[tmp_name] =>
[error] => 6
[size] => 0 ) )
[edited by: adnanqureshi at 7:42 pm (utc) on Aug. 19, 2008]
As soon as I switched mapping from ISAPI to CGI, upload started working BUTTT, now there were couple of variables, which were supported only by ISAPI (like DOCUMENT_ROOT), I was using in application are no more working, is there any SMART way to make my application CGI compatable?