Home : Products : DBMan : Customization :

Products: DBMan: Customization: Re: [kellner] Problems with users and file upload (with solution to spaces in file name problem): Edit Log

Here is the list of edits for this post
Re: [kellner] Problems with users and file upload (with solution to spaces in file name problem)
I also got the problem with display an uploaded image on the sub html_record_long.
I got a modify to place an image on the long html and others upload just link to.
The image will broken not show properly if user has removed the first image and not make a new upload.

Code:
# put the photos into an array called @photo
if (-e "$SAVE_DIRECTORY/$rec{$db_key}") {
opendir (GRAPHIC, "$SAVE_DIRECTORY/$rec{$db_key}") or &cgierr("unable to open directory: $SAVE_DIRECTORY/$rec{$db_key}. Reason: $!");
@files = readdir(GRAPHIC);
closedir (GRAPHIC);
@photo = qw();
foreach $file (@files) {
next if ($file =~ /^\./); # Skip "." and ".." entries..
next if ($file =~ /^index/); # Skip index.htm type files..
push(@photo, $file);
}
}

# then to print out individual photos on the page
print qq|<div align="center"><table border="0" $displaybg2 cellspacing="0" cellpadding="8">
<tr><td><img src="$SAVE_DIRECTORY_URL/$rec{$db_key}/$photo[0]"></td></tr></table></div>|;

Q:How can it show another image instead and if user dont want to show that another image,then let he choose whhich image he want to be displayed. may be just ask he to upload a file name "1.gif or 1.jpg" and if 1.gif/jpg available then display 1.gif/jpg ,else display another.

Any comment?
Love you all,and thank for all help here ,this is a greatest forum.
Act.

Last edited by:

act: Nov 20, 2001, 6:50 AM

Edit Log: