Question about FileContent module

LabKey Support Forum (Inactive)
Question about FileContent module rosnerd  2007-07-27 13:12
Status: Closed
 
Pardon my cross posting but I just realized this question might
be better asked on the developer's list.

I'm trying to use the filecontent module in 2.1 based on
instructions described in previous post by Mark Igra on 6/26/07
included below.

I've tried these instructions on my 2.1 installation with no success.

Before I dig any deeper, can you confirm that filecontent module was
included in the 2.1-6772 build. I checked the ~/modules directory
and was expecting to see something like filecontent. However I wasn't
able to find anything like that.

Thank you.

Dan

+++ Begin Mark's original message +++

The somewhat experimental FileContent module may be what you want. This allows you to set up a file system directory tree on disk that parallels the folder hierarchy you've defined in your project. The server will return files from your file system given the correct URLs.

To configure the root directory for the home project go to:

http://localhost:8080/labkey/FileContent/home/begin.view

For any other project, substitute the project name for "home" in the above URL. And of course substitute your proper server, port & context path.

This page should give you a set of hints on how to use the module. If you place test.html in the root of your file tree you will be able to retrieve it using

http://localhost:8080/labkey/FileContent/home/sendFile.view?fileName=test.html

The accompanying files servlet is configured to return the files using standard URL, so instead of using sendFile.view?fileName=test.html

http://localhost:8080/labkey/files/home/test.html

would work. This allows you to have URLs that look like they come from a standard web app, but have LabKey's per-folder security enforced.

+++ End Mark's original message +++
 
 
jeckels responded:  2007-07-27 15:04
Dan,

Due to its experimental nature, in 2.1 the FileContent module isn't part of the standard distribution. I'm attaching the file to this response. To deploy it, copy it into your modules directory. You could also build it from the source code yourself if you'd like.

Josh
 
rosnerd responded:  2007-07-31 00:01
Thank you for the response and attachement.
I'll try to make it somewhat less experimental.

Dan
 
rosnerd responded:  2007-08-15 00:04
I'm unable to set the web root in the FileContent module in 2.1

When I click the submit button after entering the web root configuration parameter, it
appears to neither get set nor saved.

Is this a known problem? Is there a fix?

Dan
 
marki responded:  2007-08-15 08:10
It's a bug. Actually the button is not hooked up, you just have to hit Enter to submit the form from the keyboard.
 
rosnerd responded:  2007-08-21 00:44
Title: Configuring FileServlet for use with FileContent module
I'm trying to configure FileServlet in web.xml as described
on the FileContent module configuration page. However I'm getting this
error:

SEVERE: Parse error in application web.xml file at jndi:/localhost/WEB-INF/web.xml
java.lang.IllegelArgumentException: addChild: Child name 'FileServlet' is not unique


This was caused by adding the following lines to web.xml

    <servlet>
        <servlet-name>FileServlet</servlet-name>
        <servlet-class>org.labkey.api.view.FileServlet</servlet-class>
    </servlet>

    <servlet-mapping>
            <servlet-name>FileServlet</servlet-name>
            <url-pattern>/files/*</url-pattern>
        </servlet-mapping>

Any ideas what's causing this?

Dan