[Catalyst] Content Disposition filename

2013-11-19 Thread Bill Moseley
Anyone aware of a good, portable way in Perl to encode the filename in a
Content-Disposition header? I would like to support UTF8 filenames, but
support in browsers is unclear (if not changing).

Is this complexity something that the Catalyst framework should handle?
It's one of those areas where it's easy to get wrong (I can see many
different approaches in our own code).

http://greenbytes.de/tech/tc2231/

http://stackoverflow.com/questions/93551/how-to-encode-the-filename-parameter-of-content-disposition-header-in-http

Thanks,

-- 
Bill Moseley
mose...@hank.org
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Content-Disposition filename and delayed download

2010-12-03 Thread Bill Moseley
Hi,

What's the recommended approach to the filename used in downloads?  I would
like to allow users to specify the filename (or, say, use an existing
user-provided name or title) which means I'd likely need to encode in utf-8.

But, I'm not sure what conclusion to draw from looking at
http://greenbytes.de/tech/tc2231/

RFC2183 says the values should be 78 characters and limited to ASCII.  2184
and then 2231 discusses encoding but it seems not well supported if I'm
reading those test correctly.

See: http://www.ietf.org/rfc/rfc2231.txt


Now, say I have to dynamically generate the download and it might take
longer than a normal web request.  In the past I've opened another window
and used a meta refresh to poll the server until the download is ready.
 Seems a bit old-school.

Can anyone point me to an example of a better approach?  I've seem
suggestions of using iframes or polling with AJAX.

I've also see suggestions that it's important to not set no-cache headers
for IE when sending the download.


I'm not quite clear if I want to send Connection: close when polling.  The
idea is I don't want to hold up a web server process when the client is
polling for the download, but the load balancer should allow for keep-alive
connection on the client side but not tie up a single web server process.





-- 
Bill Moseley
mose...@hank.org
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Content-Disposition filename

2010-12-02 Thread Bill Moseley
What's the current thought on the filename value?

RFC2183 says the values should be 78 chars and limited to ASCII.  2184 and
then 2231 discuss encoding but not clear how well supported.
See http://greenbytes.de/tech/tc2231/ for various tests on browsers.

Should I limit to 78 characters and then percent-encode the encoded utf8
string?

uri_escape( encode( 'UTF-8', substr($name, 0, 78) ) );

Or encode to US-ASCII and let encode replace non ASCII with ??  That seems
ugly.



Too bad HTTP::Headers doesn't abstract all this out.



-- 
Bill Moseley
mose...@hank.org
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/