You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Kalle Malin <ka...@surveypal.com> on 2014/01/07 08:10:35 UTC
VS: Setting Content-Disposition header containing Finnish alphabets å, ä or ö
Hi Andrew,
I could first try enabling logging if you could point out how to do it? With Gist or Pastie I'm unfamiliar but if logs provide no help then I will familiarize myself with either of those. Basically I have just followed the upload by the way provided in examples and tried both SwiftObject and Blobs.
Regards,
Kalle
________________________________________
Lähettäjä: Andrew Phillips [andrewp@apache.org]
Lähetetty: 31. joulukuuta 2013 14:47
Vastaanottaja: user@jclouds.apache.org
Aihe: Re: Setting Content-Disposition header containing Finnish alphabets å, ä or ö
Hi Kalle
> So my question is am I doing something wrong while setting the
> header? Should it be encoded? Can I even accomplish this with Jclouds?
Could you put some sample code in a Gist or Pastie [1, 2] so we can
see how you are trying to upload a blob via jclouds? Could you also
enable wire and header logging temporarily [3] and capture the request
so we can see what's actually being sent? Please ensure all sensitive
information is removed from the logs, obviously.
Thanks!
ap
[1] http://gist.github.com
[2] http://pastie.org
[3] http://jclouds.apache.org/documentation/reference/jclouds-logging/
and
https://github.com/jclouds/jclouds/blob/master/compute/src/test/resources/logback.xml#L44
Re: VS: VS: Setting Content-Disposition header containing Finnish alphabets å, ä or ö
Posted by Andrew Phillips <an...@apache.org>.
> And the result for Content-Disposition "cöwböys änd åliens.png" in
> the Rackspace cdn Content-Disposition is "cöwböys änd åliens.png".
Are you seeing the malformed version of the disposition in the
Rackspace console? Or is this reported by jclouds somehow?
Could you try to *read* the blob back using jclouds and see what
Rackspace sends back? That should also be in the logs...
Regards
ap
VS: VS: Setting Content-Disposition header containing Finnish alphabets å, ä or ö
Posted by Kalle Malin <ka...@surveypal.com>.
I manage to setup logging. Based on the log of Content-Disposition it seems fine.
Code used to create and set Content-Disposition in short:
final SwiftObject object = cloudFilesClient.newSwiftObject();
object.setPayload(new ProgressInputStream(fileUpload, uploadProgress));
object.getPayload().getContentMetadata().setContentDisposition(MessageFormat.format("attachment; filename=\"{0}\"", fileName));
Jclouds log for Content-Disposition shows:
2014-01-07 11:40:44.762 org.jclouds.logging.slf4j.SLF4JLogger.logDebug:59 [main]
DEBUG: >> Content-Disposition: attachment; filename="cöwböys änd åliens.png"
That was the only reference of Content-Disposition in the log.
And the result for Content-Disposition "cöwböys änd åliens.png" in the Rackspace cdn Content-Disposition is "cöwböys änd Ã¥liens.png".
I tried setting the cdn file name to "cöwböys änd åliens.png" and that works. So only header gets malformed.
- Kalle -
________________________________________
Lähettäjä: Andrew Phillips [andrewp@apache.org]
Lähetetty: 7. tammikuuta 2014 11:38
Vastaanottaja: user@jclouds.apache.org
Aihe: Re: VS: Setting Content-Disposition header containing Finnish alphabets å, ä or ö
> then I will familiarize myself with either of those. Basically I
> have just followed the upload by the way provided in examples and
> tried both SwiftObject and Blobs.
Do you mean the examples in the jclouds-examples repo [1]? As far as
configuring logging, this good blog by Everett might help [2].
ap
[1] https://github.com/jclouds/jclouds-examples
[2] http://blog.phymata.com/2012/08/18/logging-in-jclouds/
Re: VS: Setting Content-Disposition header containing Finnish alphabets å, ä or ö
Posted by Andrew Phillips <an...@apache.org>.
> then I will familiarize myself with either of those. Basically I
> have just followed the upload by the way provided in examples and
> tried both SwiftObject and Blobs.
Do you mean the examples in the jclouds-examples repo [1]? As far as
configuring logging, this good blog by Everett might help [2].
ap
[1] https://github.com/jclouds/jclouds-examples
[2] http://blog.phymata.com/2012/08/18/logging-in-jclouds/