[Solar-talk] Blob 'server'
Kilbride, James P.
James.Kilbride at gd-ais.com
Thu Jan 24 12:21:11 CST 2008
Hmm hadn't thought of the passing via streams but that might not be a
bad idea either. Though since the files are getting uploaded now I have
to work out directory structures and file management on the upload
servlet as well rather than simply shoving into the database.
James Kilbride
-----Original Message-----
From: solar-talk-bounces at lists.solarphp.com
[mailto:solar-talk-bounces at lists.solarphp.com] On Behalf Of Paul M Jones
Sent: Thursday, January 24, 2008 12:29 PM
To: solar-talk at lists.solarphp.com
Subject: Re: [Solar-talk] Blob 'server'
On Jan 24, 2008, at 10:24 , Kilbride, James P. wrote:
> Anybody done anything where they need to provide a binary image to
> users with some form of authentication/authorization format? Basic
> standard CMS type thing where you need to store documents or images or
> some other binary data and only certain users should have access to
> it. So you need the controller to do a standard authorization check
> and then pull the data from somewhere to serve back up? Have you done
> this with solar (is there a standard component for this?
> It'd be great if there was.) My plan was to store them in the database
> as clobs(which i know isn't a solar type but was planning to the model
> to have one column like that) and then make sure the view or
> controller sets the type to other than text.
>
Done things like that before, but a long time ago, before Solar. No,
there's no Solar-standard component for it; however, my suggestions
based on that earlier experience follow.
In the DB, store the path to the file, not the file itself (and maybe
the mime type, file name, etc). Keep the file itself outside the web
root. Then the controller can check authentication/authorization, and
if successful, it can respond by reading the file from the filesystem
and passing via stream to the browser (vs linking to the file directly).
Keeping the binary file in the DB under a CLOB type (which
*is* a Solar generic type, generally represented as a "longtext" in
MySQL) is, in my opinion, to be avoided when possible.
Hope that helps.
-- pmj
_______________________________________________
Solar-talk mailing list
Solar-talk at lists.solarphp.com
http://mailman-mail3.webfaction.com/listinfo/solar-talk
More information about the Solar-talk
mailing list