CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
icon association with file uploads

 



epiphysis
Deleted

Mar 1, 2001, 9:29 PM

Post #1 of 2 (152 views)
icon association with file uploads Can't Post

hi-

I am looking for a snippet or some general guidance that will help me add a fuction for my file upload script.

I want a pre-specified icon to be displayed for its associated file type (.wav = audio icon, image = image icon etc...)

I am working on figuring it out but any help would be great.

Thank you-

epi




epiphysis
Deleted

Mar 1, 2001, 10:05 PM

Post #2 of 2 (151 views)
Re: icon association with file uploads [In reply to] Can't Post

Maybe something like this?
Thought I was on the right track with this but... I am embedding it into a php file....for some reason I get internal error when attempt to upload ??

my ($file) = lc(shift);
my ($ext) = $file =~ /\.([^.]+)$/;
if (!$ext) { return "$config{'icondir_url'}/$icons{'unknown'}"; }
foreach (keys %icons) {
next if (/folder/);
next if (/unknown/);
next if (/parent/);
($_ =~ /$ext/i) and return "$config{'icondir_url'}/$icons{$_}";
}
return "$config{'icondir_url'}/$icons{'unknown'}";
}


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives