Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Question For File Save Method in 2.05

Quote Reply
Question For File Save Method in 2.05
Hi,

What is different in between HASHED and SIMPLE ?

TheFox


Quote Reply
Re: Question For File Save Method in 2.05 In reply to
Hi,

Simple will put all the files in one directory with ID-filename saving scheme. Hashed will put files in subdirectories, and should be used if you expect more then 10,000 files. You can always access the files through jump.cgi:

jump.cgi?ID=link_id&view=ColumnName

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Question For File Save Method in 2.05 In reply to
Hi alex,

How would we go about accessing the image from within the templates.

for example. I have a field called Image1 (defined as hash and the uploading works fine)
So I'm trying to access <img src=<%build_images_url%>/links/<%ID%>/<%ID%>-<%Image1%>.
In this case the record ID is equal to 37.

but that doesn't work because the upload process put this image into a folder called 2 then named it 2-filename.jpg

It doesn't really make sense to force the call for the image through jump.cgi as you suggest (I can certainly see why one would want to), but I don't know of another way to access the image when I have know way of knowing what folder it was put into.

Suggestions?

thanks and peace.


Quote Reply
Re: Question For File Save Method in 2.05 In reply to
I get a download box. but the attachment is a simple gif image, how can I solve this?????
I have this in the admin too.

Quote Reply
Re: Question For File Save Method in 2.05 In reply to
Hi,

You would need a global for this:

file_url =>

Code:
sub {
my $tags = shift;
my $file = $DB->table('Links')->file_info ('YourColumn', $tags->{ID});
my ($url) = $file =~ m,/path/to/file/root/(.*),;
return $url;
}
$file is a CGI.pm style filehandle. It behaves like a string which is the full path to the file, or it can be used to pass into open(), close(), as a filehandle.

We'll look at making this simple and built in in the next release.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Question For File Save Method in 2.05 In reply to
Hi Alex,

Sorry for bring up this very old thread, but I wondered if you ever made this process of displaying an image in the detailed template simpler, as you stated you would. Using jump.cgi seems the only way to display an image when using HASHED as the stored method.

--------------------------------
Privacy Software
Quote Reply
Re: [BLOOD] Question For File Save Method in 2.05 In reply to
is still jump.cgi the only way to display an image when using the HASHED method?
Quote Reply
Re: [Alex] Question For File Save Method in 2.05 In reply to
I did't understand that?

I have 2.1.2 installed and in the table Links_Files are all information about path and so on.

All picture are stored correct in the database, but I didn't get them out.

How can I get them out, if I need a global for that which builds my URL,

what for all these things are stored in the database?

Thanks, Chris
Thanks a lot for your help,
Christian