Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Content Disposition Header in an HTTP response is not retrieved properly (Known Issue)

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 5th Edition
S60 5th Edition
Article
Keywords: HTTP Headers, EContentDisposition
Created: User:TechnicalWriter2 (23 Jun 2009)
Last edited: hamishwillee (01 Aug 2012)


Description

When downloading attachments, the name of the attachment can be found by reading the header HTTP::EContentDisposition in the HTTP response. However, in S60 5th Edition devices, the header cannot be read fully and only a partial header string is retrieved.

How to reproduce

The WebClient application available in the SDK can be used to download an attachment and the following code snippet can be used to read the EContentDisposition header once the HTTP response is received.

 void CWebClientEngine::MHFRunL( RHTTPTransaction aTransaction, 
const THTTPEvent& aEvent )
{
switch ( aEvent.iStatus )
{
case THTTPEvent::EGotResponseHeaders:
{
RHTTPResponse resp = aTransaction.Response();<br>
RHTTPHeaders hdr = resp.GetHeaderCollection();
RStringPool strP = iSession.StringPool();
RStringF contentDisp = strP.StringF(HTTP::EContentDisposition, RHTTPSession::GetTable());<br>
THTTPHdrVal tempHdrVal;
TInt err = headers.GetField(contentDisp, 0, tempHdrVal);
if (err == KErrNone)
{
RStringF field = tempHdrVal.StrF();
const TDesC8& fieldValDesC = field.DesC(); //the buffer fieldValDesC<br> //doesn't contain the entire header information
field.Close();
}
contentDisp.Close();
}
break;

Expected Result: The descriptor fieldValDesC, in the above code, should contain the entire header information, including the attachment name.

Actual Result: The descriptor fieldValDesC contains only partial information and doesn't contain the attachment name.

Solution

No Known Solution.

This page was last modified on 1 August 2012, at 04:39.
266 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×