File Uploads Can not be Opened
Posted: Wed Jan 08, 2003 6:24 pm
Getting these errors:
Warning: Unable to open 'file1' for reading: No such file or directory in /home/clinical/public_html/admin/journal/article/art4/add_files.phps on line 18
Warning: Unable to open 'file2' for reading: No such file or directory in /home/clinical/public_html/admin/journal/article/art4/add_files.phps on line 18
Warning: Unable to open 'file3' for reading: No such file or directory in /home/clinical/public_html/admin/journal/article/art4/add_files.phps on line 18
Warning: Unable to open 'file4' for reading: No such file or directory in /home/clinical/public_html/admin/journal/article/art4/add_files.phps on line 18
Warning: Unable to open 'file5' for reading: No such file or directory in /home/clinical/public_html/admin/journal/article/art4/add_files.phps on line 18
Already fixed issue with upload_tmp_dir not being set.
Any other ideas?
Here is the code:
Warning: Unable to open 'file1' for reading: No such file or directory in /home/clinical/public_html/admin/journal/article/art4/add_files.phps on line 18
Warning: Unable to open 'file2' for reading: No such file or directory in /home/clinical/public_html/admin/journal/article/art4/add_files.phps on line 18
Warning: Unable to open 'file3' for reading: No such file or directory in /home/clinical/public_html/admin/journal/article/art4/add_files.phps on line 18
Warning: Unable to open 'file4' for reading: No such file or directory in /home/clinical/public_html/admin/journal/article/art4/add_files.phps on line 18
Warning: Unable to open 'file5' for reading: No such file or directory in /home/clinical/public_html/admin/journal/article/art4/add_files.phps on line 18
Already fixed issue with upload_tmp_dir not being set.
Any other ideas?
Here is the code:
Code: Select all
<h3>Add Files:</h3>
<form method=post action=<?php echo $PHP_SELF . "?artid=$artid" ?> enctype='multipart/form-data'>
<b>*Filenames can only have alphanumeric symbols and underscores (_). No spaces.</b><br>
їphp]
<?php
$file_fields_count=5;
#File Uploads
if(isset($_POSTїupload]))
{
for($i=1; $i<=$file_fields_count; $i++)
{
$file="file$i";
if($file)
{
copy($file, "$curfilespath/$file_name");
if($i==1 && isset($_POSTїpdf]))
{
mysql_query("UPDATE article SET pdf=$file_name WHERE id=$artid");
}
}
else
{
unlink($file);
}
}
}
#File Fields Output
for($i=1; $i<=$file_fields_count; $i++)
{
$fieldname= 'file' . $i;
echo "\t<input type=file name=$fieldname size=50><br>\n";
if($i==1)
{
echo "\t<input type=checkbox name=pdf>PDF version of the article.<br>\n";
}
}
?>ї/php]
<input type=submit name=upload value=Upload>
</form>