On Wed, 12 Mar 2008 08:55:37 +0200
"Suha Onay" <[EMAIL PROTECTED]> wrote:

> Yes Daniel is right.
> Sorry about the wrong question.
> I am talking about providing a link to some downloadable content,
> e.g., a spreadsheet or an image. How is it possible in nevow?
> 
> On Tue, Mar 11, 2008 at 8:51 PM, L. Daniel Burr <[EMAIL PROTECTED]>
> wrote:
> 
> > On Tue, 11 Mar 2008 13:37:08 -0500, <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > On 04:31 pm, [EMAIL PROTECTED] wrote:
> > >> I am a newbie of nevow. I want to open a save as dialog and
> > >> enable the user
> > >> to save files.
> > >
> > > Are you talking about uploading a file to the server, or saving a
> > > file on the client?  (You can't save files on the client in a web
> > > browser in any way that I'm aware of.)
> > >
> >
> > I think the OP is talking about providing a link to some
> > downloadable content, e.g., a spreadsheet or an image, that should
> > trigger the browser's download behavior.

You should use nevow.static.File, a quick example (save in example.tac
and run with "twistd -noy example.tac"):

  from nevow import static, appserver
  from twisted.application import service, internet, strports

  application = service.Application("example")
  site = appserver.NevowSite(
              resource=staic.File("thing.jpeg", "image/jpeg"))
  server = strports.service("tcp:8080", site)
  server.setServiceParent(application)

You can construct a nevow.static.File passing a path to a directory,
and you will be serving all the contents of the directory.

Cheers,

-- 
~
~
~
".signature" 4 lines, 50 characters written

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to