| ID | KIS001442 | Creation date | June 23, 2009 |
| Platform | S60 5th Edition | Devices | Nokia 5800 XpressMusic |
| Category | Symbian C++ | Subcategory | Networking |
| Keywords (APIs, classes, methods, functions): HTTP Headers, EContentDisposition |
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.
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.
No Known Solution.