The upload component will give you the mime-type. Store that and return it
in the stream response.


On Fri, Sep 27, 2013 at 10:26 AM, Steve <steves...@gmail.com> wrote:

> Hi,
>
> Sorry for another message, just another (very quick, and related) question.
> These files which are uploaded can be of any type. In order to display them
> on the page (rather than download them), I use a component I made named
> "MediaViewer". The "MediaViewer" takes in a file as a param and uses blocks
> for various ways to render the media. There is a method which checks the
> extension, which then decides exactly which block to show to render the
> media (e.g, for java source code it uses a prettify library, or for a PDF
> it embeds it).
>
> Does this design sound ok, or am I over complicating something? The
> important part is that the file is viewable on the page rather than
> downloaded. There is a relatively limited number of file types which will
> need supporting, including text documents, source code, images and word
> processed documents - all of which I can embed using some library or
> another.
>
> Thanks again,
>
> Steve
>
>
> On 27 September 2013 15:52, Steve <steves...@gmail.com> wrote:
>
> > Hi,
> >
> > Ok, I understand exactly what I need to do now. It's going to take me a
> > bit of time to change what I have done so far but this is exactly the
> > information I needed.
> >
> > It will probably be a few days (especially with it being the weekend) for
> > me to make the changes in what I have so i'll get back to you soon and
> let
> > you know how it goes.
> >
> > Thanks again for your help, can't say enough how much trouble this has
> > probably saved me.
> >
> > Steve
> >
> >
> >
> > On 27 September 2013 15:09, Thiago H de Paula Figueiredo <
> > thiag...@gmail.com> wrote:
> >
> >> On Fri, 27 Sep 2013 11:04:41 -0300, Barry Books <trs...@gmail.com>
> wrote:
> >>
> >>  Depending on your needs I would either put them in a database or on
> >>> Amazon S3. Then write a page that retrieves them and returns them with
> a
> >>> stream
> >>> response.
> >>>
> >>
> >> This solution is the best one because it adds a point in which you can
> >> put any security (authorization) logic you want.
> >>
> >> --
> >> Thiago H. de Paula Figueiredo
> >>
> >>
> ------------------------------**------------------------------**---------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<
> users-unsubscr...@tapestry.apache.org>
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
> >
>

Reply via email to