N!ck
03-03-2003, 01:42 AM
Following is part of a script I'm working on to upload pictures. I'm getting an error that no file was uploaded, but this is just not the case. I double-checked that I have the attribute on my form tag (enctype="multipart/form-data"), and I also made sure that the name of the file field was correct.
Does anyone see anything that might be causing the problem?
...
if ($action=="upload") {
if ($bbuserinfo[userid]=="0" or $bbuserinfo[userid]=="") {
show_nopermission();
exit;
}
if (empty($picfile)) {
eval("standarderror(\"".gettemplate("error_gallery_nopic")."\");");
exit;
}
$filename=str_replace(" ","_",$picfile_name);
$targetname=$gallerypath."/photos/".$bbuserinfo[userid]."/".$filename;
$targetthumb=$gallerypath."/thumbs/".$bbuserinfo[userid]."/".$filename;
if (file_exists($targetname) or file_exists($targetthumb)) {
eval("standarderror(\"".gettemplate("error_gallery_filename")."\");");
exit;
}
...
Does anyone see anything that might be causing the problem?
...
if ($action=="upload") {
if ($bbuserinfo[userid]=="0" or $bbuserinfo[userid]=="") {
show_nopermission();
exit;
}
if (empty($picfile)) {
eval("standarderror(\"".gettemplate("error_gallery_nopic")."\");");
exit;
}
$filename=str_replace(" ","_",$picfile_name);
$targetname=$gallerypath."/photos/".$bbuserinfo[userid]."/".$filename;
$targetthumb=$gallerypath."/thumbs/".$bbuserinfo[userid]."/".$filename;
if (file_exists($targetname) or file_exists($targetthumb)) {
eval("standarderror(\"".gettemplate("error_gallery_filename")."\");");
exit;
}
...