For example (my most major gripe):
return serveFile([...])
Does not work like it should. When the file is unmodified (I know
there's a ticket for this...) it returns a list or something like that,
yet, still sets the headers for content disposition, content length,
all that jazz, so... what? Manually reset them before returning the
correct headers (304 Not Modified)?
Also, when it *does* work, if your filename contains spaces, it doesn't
send you a working file. Sure, if the downloader were to *know* what
file type they were getting, they could add the extension. This is
ridiculously easy to fix:
http://www.turbogears.org/docs/api/source/cherrypy.lib.cptools-module.html#262
Simply double-quote the filetype param of the Content-Disposition
header. I mean, seriously... Even the FileUploadTutorial doesn't
address this. If someone were to be trying Turbogears out and file
uploading/download were important to them... odds are they'll try
something with a space in. Oops, **** that, it doesn't work.
Sorry for the rant, but honestly, this is really frustrating.
-Sam
> address this. If someone were to be trying Turbogears out and file
> uploading/download were important to them... odds are they'll try
> something with a space in. Oops, **** that, it doesn't work.
Probably due to my Unix background, but I have no files on my system with
spaces in it. And no files with accented letters.
This is a common practice in Windows, though. (And even there I've seen lots
of programs that had problems with spaces and accented letters, so they should
also be avoided there...)
I would only test spaces if I remembered that but I'd probably be bitten by
such a problem when going to the user-test environment.
--
Jorge Godoy <jgo...@gmail.com>
Although serveFile only sets Content-Type if the file has not been
modified, it probably shouldn't even do that. I've filed a ticket for
this:
http://www.cherrypy.org/ticket/544.
The "filename" parameter of a Content-Disposition header should always
be quoted whether it has spaces or not. Filed as:
http://www.cherrypy.org/ticket/545.
Robert Brewer
System Architect
Amor Ministries
fuma...@amor.org
Thanks again,
Sam