Page 1 of 1

attachment urls

Posted: 29 Mar 2010, 21:44
by archiseek
when you view an attachment the url is in the format

/jobs.php?m=attachments&a=getAttachment&id=9&directoryNameHash=53dcd98bcde9d9dc2fd6419edadfd6b1

the directoryNameHash value at the end
which table in the db is this stored?

Re: attachment urls

Posted: 29 Mar 2010, 22:04
by RussH
Hi,

that'd be the table called 'attachment' :-)

..in a field called directory_name

...possibly. I don't have attachments in the jobs pages. Perhaps it bears some investigation?

Re: attachment urls

Posted: 29 Mar 2010, 22:09
by archiseek
nope its not it...

attachment.directory_name is in the format
site_1/0xxx/0deaacc963bd5be2ff08e6bd7a4de37f

Re: attachment urls

Posted: 29 Mar 2010, 22:23
by archiseek
in the attachments.php in lib

we have
Code: Select all
            $rs[$index]['retrievalURL'] = sprintf(
                '%s?m=attachments&a=getAttachment&id=%s&directoryNameHash=%s',
                CATSUtility::getIndexName(),
                $data['attachmentID'],
                urlencode(md5($data['directoryName']))
is that changing the directory_name? or am i reading that wrong

Re: attachment urls

Posted: 29 Mar 2010, 22:32
by RussH
is that the md5sum that's stored in the attachments table, so it does a match against that?

Re: attachment urls

Posted: 30 Mar 2010, 14:09
by archiseek
doesnt match any value in the table

Re: attachment urls

Posted: 30 Mar 2010, 15:15
by archiseek
for example

attachment with url ending in directoryNameHash=e587f381baacf1ec2fb1531a7dac80ef

has the following values in the db

directory_name site_1/0xxx/0deaacc963bd5be2ff08e6bd7a4de37f/

md5_sum 4d1f767863b6a3985f43e9401b0739f6

Re: attachment urls

Posted: 30 Mar 2010, 15:27
by archiseek
guilty of over-thinking....
was exporting resume link to csv

of course it's simply /attachments/ directory_name

Re: attachment urls

Posted: 30 Mar 2010, 15:38
by RussH
Okay, a quick search through the code gives;


/cats/ajax/getAttachmentLocal.php: md5($rs['directoryName']) != $_POST['directoryNameHash']) - so that is just a md5 hash for the directory name.