[rt-users] Storing custom field file to local file system

Tom Lahti toml at bitstatement.net
Tue Jun 2 16:42:07 EDT 2009


>   my $url = RT->Config->Get('WebPath') .
> "/Download/CustomFieldValue/".$cf->Id.'/'.$cf->Content;
>   getstore($url,"/tmp/temp.odt");
>
> Or perhaps more easily put:  How do you extract a file from a custom
> field and store it on the local file system?

Since the custom field just names the file, set up a separate name space in
your web server (Apache?) that doesn't go through RT to fetch the document
through with getstore().

my $url = "http://not-rt.server.com/some/dir/" . $cf->Content;
getstore($url...);

If you need to secure it better make sure not-rt.server.com isn't publicly
available, or use "localhost" and clamp that down in Apache config, or whatever.

If you need RT to authenticate document access, then you're better off
storing the document as an attachment.

-- 
-- ============================
   Tom Lahti
   BIT Statement LLC

   (425)251-0833 x 117
   http://www.bitstatement.net/
-- ============================



More information about the rt-users mailing list