Now I am confused...  Are you asking me how we built our file manager to
manage files by ID?

Using a file ID to identify files is just the way that we decided to deal
with files in our application. There is nothing special about the file ID
parameter - we made it up. Nothing in Turbine knows or cares about file IDs.

We wrote a file manager service that uses a database table to keep track of
files. It contains columns for a file ID, file type, file path, owner user
ID, date created, etc.  Our application allows users to upload and download
files, and the file manager service allows us to "check in" new files, and
retrieve existing files for download. It stores the files in a directory
structure that it controls.

When the Download screen is invoked, it gets the FileID parameter from the
request and calls our file manager service, which checks to see if the the
person requesting the download is allowed to download it (is he the owner,
or in the same "group" as the owner, etc.), opens the file, and returns an
open InputStream for that file. The Download screen code then downloads the
file, as described in earlier emails.

But the real question that you need to answer is, how do YOU want to
identify files in your application? Whatever you decide, you need to write
the code to implement it. This is an application design decision, not
something that Turbine will do for you.

Hope this helps.

Kevin

-----Original Message-----
From: apdas [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 02, 2002 7:56 AM
To: Turbine Users List
Subject: Re: How to server files


Thanks Kevin for the tips.
Could you please tell me how I can assign IDs to files ? How does the
application (Download.java) recognise files by their IDs ?

Regards,
A.P.Das.

Kevin Rutherford wrote:
> 
> You can use anything you want to identify the file to be downloaded. It is
> just a parameter on the URL that your Download.java class will look at to
> identify what file to download.
> 
> We have a file manager service that tracks files by ID (a number that we
> assign) and does a security check to make sure that the person requesting
> the file is allowed to see that file. That is why we pass in the file ID
as
> a number on the URL.
> 
> If you want to use the actual file name (or path) on the URL, that is up
to
> you. Just keep in mind any security issues that might come up if anyone
can
> request any file just by specifying its name on the URL!
> 
> Kevin
>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

Reply via email to