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;
}

Quote Reply
Re: [nir] Image URL In reply to
Hi,

Mmmm.. not sure. When I've had issues with stuff like that (on a French site I worked on), I had to re-write some of GT::SQL::File, and re-write some of the uploading functions, so that it converted the filenames to english charachters (so the global would work)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Image URL In reply to
Hi
The name of the file change, to somting like this
79-%F8%E5%FA%20%EE%E2%E3%20-%20%FA%F7%F9%E5%F8%FA%20%E5%E9%E7%F1%E9%20%F6%E9%E1%E5%F82.jpg

The problem is that the browser fail to read it.
When I download the image it display it good.
Quote Reply
Re: [nir] Image URL In reply to
Stab in the dark - but what if you comment out:

Code:
$rel_path =~ s|([^\/]+)$|GT::CGI->escape( $1 )|e;

?

i.e:

Code:
#$rel_path =~ s|([^\/]+)$|GT::CGI->escape( $1 )|e;

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Image URL In reply to
It already in the code.Frown
The problem is that the Firefox and IE fail to read it,
In the browser.cgi it success to display it
Quote Reply
Re: [nir] Image URL In reply to
It workSmileSmile
Sorry my mistake
Thanks
Quote Reply
Re: [nir] Image URL In reply to
Cool =)

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!