please make a case for this in jira. (with that patch)

On 10/29/07, wheleph <[EMAIL PROTECTED]> wrote:
>
>
>
> wheleph wrote:
> >
> > Content-Disposition attachment; filename=%D0%A1 ...
> > I wonder what encoding is it?
> >
>
> It's url encoding. I used URLCodec from commons-codec
> (http://commons.apache.org/codec/) package to encode file name for IE but
> for FF I still need Base64 or Q-encoding. That's why I need to detect the
> type of user's browser and send appropriately encoded file name (see the
> snippet below). I think it would be nice improvement for DownloadLink to
> perform the encoding of file name internally.
>
> [code]
>        WebResponse r = (WebResponse) requestCycle.getResponse();
>        WebClientInfo clientInfo = (WebClientInfo)
> requestCycle.getClientInfo();
>        final String userAgent = clientInfo.getUserAgent();
>        logger.info("userAgent: " + userAgent);
>
>        StringEncoder codec = null;
>        if (userAgent.indexOf("MSIE") != -1) {
>                codec = new URLCodec();
>        } else {
>                codec = new BCodec();
>        }
>        final String name = ecoFile.getName();
>        String encodedName = null;
>        try {
>                encodedName = codec.encode(name);
>        } catch (EncoderException e) {
>                encodedName = ecoFile.getName();
>                final String message = "Error while encoding name " + name
> + " with codec
> " + codec;                                      logger.warn(message, e);
>        }
>        r.setAttachmentHeader(encodedName);
>
>        // copy byte stream from file to response...
> [/code]
>
> wheleph
> --
> View this message in context:
> http://www.nabble.com/IE-DownloadLink-problems-tf4697141.html#a13462367
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to