My apologies for taking so long to respond to this thread. In addition to
Aaron's "getfile.cfm"--a very nice solution--GaeVFS contains a built-in
servlet that allows you to do directory listings and serve files from
configured directories. In order to use the GaeVfsServlet, add the following
to your web.xml (this example serves files from the "/images" directory of
your webapp):

    <servlet>
        <servlet-name>gaevfs</servlet-name>

 
<servlet-class>com.newatlanta.commons.vfs.provider.gae.GaeVfsServlet</servlet-class>
        <init-param>
            <param-name>dirListingAllowed</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>initDirs</param-name>
            <param-value></param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>gaevfs</servlet-name>
        <url-pattern>/images/*</url-pattern>
    </servlet-mapping>

You can then serve files by using normal IMG tags:

    <img src="/images/mypicture.jpg">

You can serve files from as many directories as you'd like by adding
multiple <servlet-mapping> elements and specifying the appropriate
<url-pattern> elements. Also note the "dirListingAllowed" init parameter
which enables/disable directory listings. Further details are available in
the javadoc comments in the source code:

http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlanta/appengine/servlet/GaeVfsServlet.java

You can see the GaeVfServlet in action here (this is my test site--feel free
to upload files, but don't be surprised if they get deleted):

http://gaevfs.appspot.com/

Note that I'm preparing a new release of GaeVFS that will also be included
with OpenBD/GAE in the next few weeks. The packages have been changed since
the last release, so when the new one comes out you'll need to update your
web.xml to reflect the new package structure.

Vince

On Tue, Nov 24, 2009 at 2:01 PM, Aaron Lynch <[email protected]> wrote:

> Hey Paul, here is one way of accessing your images from the VFS.
>
>
> http://aaronjlynch.com/blog/2009/11/24/Google-App-Engines-Virtual-File-System-with-OpenBD
>
>
> cliffs:  <img src="getfile.cfm?f=myimagename.jpg"/>
>
>
> -Aaron
> www.AaronJLynch.com
> www.InstantSpot.com
>
>
> On Nov 9, 7:02 pm, "Paul Kukiel" <[email protected]> wrote:
> > I have OpenBD on GAE.
> >
> > I used cfhttp to get a file ( picture.png ) I then used cffile to write
> this
> > to the VFS.
> >
> > cfdirectory lists the file here:
> >
> >
> /base/data/home/apps/myapp/1.337642045380650872/gae:/base/data/home/apps/web
> > sheppaul/1.337642045380650872
> >
> > As z.png
> >
> > How can I then reference that file so I can then use z.png as an image ie
> > <img src="somePath" />
> >
> > Paul.
>
>

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 mailing list - http://groups.google.com/group/openbd?hl=en

 !! save a network - please trim replies before posting !!

Reply via email to