Gossamer Forum
Quote Reply
Image URL
I use non English word and when there are time that user upload image with no English name, when I display the image it not find the image.
But in the browser it success to display the image.
Is there a way to solve it?
I use Andy global –

Code:
sub {
my ($ID,$field) = @_;
my $table = 'Users';
# make sure a fieldname and ID are provided...
if (!$ID || !$field) { return "You need to define the ID and fieldname. Example: &lt\;%Plugins::Thumb_Images::ThumbURL(\$ID,FieldName)%&gt\;"; }
# get the actual path to where the file is/will be saved...
my $schema = $DB->table($table)->cols;
my $path = $schema->{$field}->{'file_save_url'};
$path =~ s,/$,,; # get rid of trailing / at end of $path
# now we have the highest ID, lets get the image stuff for this link.
my $col = $field; # column name where file is held
my $tbl = $DB->table($table);
my $fh = $tbl->file_info( $col, $ID ); # return a glob reference to the file that you can print <$fh> if you want
my $rel_path;
if ($fh) {
$rel_path = $fh->File_URL;
} else { return; }
undef $fh; # explicit close of the filehandle for good measure
$rel_path =~ s|([^\/]+)$|GT::CGI->escape( $1 )|e;
return $rel_path;
}

Subject Author Views Date
Thread Image URL nir 5274 Jun 24, 2009, 3:35 AM
Thread Re: [nir] Image URL
Andy 5157 Jun 24, 2009, 3:46 AM
Thread Re: [Andy] Image URL
nir 5146 Jun 24, 2009, 4:38 AM
Thread Re: [nir] Image URL
Andy 5166 Jun 24, 2009, 4:43 AM
Thread Re: [Andy] Image URL
nir 5132 Jun 24, 2009, 4:48 AM
Thread Re: [nir] Image URL
nir 5126 Jun 24, 2009, 4:54 AM
Post Re: [nir] Image URL
Andy 5132 Jun 24, 2009, 4:57 AM