httpdownloadmgrcommon.h File Reference

KMaxUrlLength

const TIntKMaxUrlLength

KMaxChunkSize

const TIntKMaxChunkSize

KMaxDefAttrLength

const TUintKMaxDefAttrLength

KMaxRealmLength

const TUintKMaxRealmLength

KMaxContentTypeLength

const TUintKMaxContentTypeLength

KMaxDispositionTypeLength

const TUintKMaxDispositionTypeLength

KDefaultPort

const TInt32KDefaultPort

KDefaultContentLength

const TInt32KDefaultContentLength

KMaxGeneralHeaderFieldLength

const TUintKMaxGeneralHeaderFieldLength

KHashLength

const TIntKHashLength

Length of a digest hash when represented in hex

KRawHashLength

const TIntKRawHashLength

Length of a digest hash before converting to hex.

KDefaultFotaPckgId

const TInt32KDefaultFotaPckgId

Default FOTA package id. Default means no FOTA download!

KNonMoIndex

const TInt32KNonMoIndex

Non-MediaObject index

KFirstMoIndex

const TInt32KFirstMoIndex

Index of first media object

KColon ( ':' )

const TIntKColon(':')

KSemiColon ( ';' )

const TIntKSemiColon(';')

KQuote ( '"' )

const TIntKQuote('"')

KEqual ( ' )

const TIntKEqual(' = ')

_LIT8 ( KHttpFieldSeparator, "\n" )

_LIT8(KHttpFieldSeparator,
"\n"
)

_LIT8 ( KHttpDispositionTypeAttachment, "attachment" )

_LIT8(KHttpDispositionTypeAttachment,
"attachment"
)

_LIT8 ( KHttpDispositionTypeInline, "inline" )

_LIT8(KHttpDispositionTypeInline,
"inline"
)

_LIT8 ( KHttpFileNameParm, "filename" )

_LIT8(KHttpFileNameParm,
"filename"
)

_LIT8 ( KCodMimeType, "text/x-co-desc" )

_LIT8(KCodMimeType,
"text/x-co-desc"
)

OMA DD specific definition

_LIT8 ( KDdMimeType, "application/vnd.oma.dd+xml" )

_LIT8(KDdMimeType,
"application/vnd.oma.dd+xml"
)

OMA DD specific definition

_LIT8 ( KDd2MimeType, "application/vnd.oma.dd2+xml" )

_LIT8(KDd2MimeType,
"application/vnd.oma.dd2+xml"
)

OMA DD specific definition

_LIT8 ( KRoapMimeType, "application/vnd.oma.drm.roap-trigger+xml" )

_LIT8(KRoapMimeType,
"application/vnd.oma.drm.roap-trigger+xml"
)

_LIT8 ( KFotaPackageDataType, "application/vnd.nokia.swupd.dp2" )

_LIT8(KFotaPackageDataType,
"application/vnd.nokia.swupd.dp2"
)

FOTA Update Package type.

_LIT8 ( KMultiPartMimeType, "multipart/related" )

_LIT8(KMultiPartMimeType,
"multipart/related"
)

OMA DD specific definition

_LIT8 ( KDrmMessageMimeType, "application/vnd.oma.drm.message" )

_LIT8(KDrmMessageMimeType,
"application/vnd.oma.drm.message"
)

DRM specific MIME type

_LIT8 ( KDrmMessageMimeTypeDrmContent, "application/vnd.oma.drm.content" )

_LIT8(KDrmMessageMimeTypeDrmContent,
"application/vnd.oma.drm.content"
)

DRM specific MIME type

_LIT8 ( KDrmMessageMimeTypeDrmDcf, "application/vnd.oma.drm.dcf" )

_LIT8(KDrmMessageMimeTypeDrmDcf,
"application/vnd.oma.drm.dcf"
)

DRM specific MIME type

_LIT8 ( KRoapPduMimeType, "application/vnd.oma.drm.roap-pdu+xml" )

_LIT8(KRoapPduMimeType,
"application/vnd.oma.drm.roap-pdu+xml"
)

DRM specific MIME type

Enum THttpDownloadState

Enumeration indicating download state. The download states from EHttpDlMoved are temporary. E.g. download adopt EHttpDlMoved state, but right after that, it returns to the original EHttpDlCompleted state.

EnumeratorValueDescription
EHttpDlCreated1
EHttpDlInprogress
EHttpDlPaused
EHttpDlCompleted
EHttpDlFailed
EHttpDlMoveddownload is moved from one client instance to another one.
EHttpDlMediaRemovedMMC card or other storage media is removed from the phone.
EHttpDlMediaInserted

MMC card or other storage media inserted and downloaded content file found on it. If MMC card inserted, but (partially) downloaded content file is not found on it, download is failed with error reason EContentFileIntegrity.

EHttpDlPausable

Download process can be paused again. This event only occurs after EHttpDlNonPausable.

EHttpDlNonPausableDownload process cannot be paused, or the content will be lost.
EHttpDlDeletedDownload is deleted from another client instance.
EHttpDlAlreadyRunningDownload is started when it's already progressing.
EHttpDlDeletingDownload is going to be deleted.
EHttpDlNonPausableNetworkLossOut of network coverage, in case of non-pausable downloads.
EHttpDlMultipleMOStarted
EHttpDlMultipleMOCompleted
EHttpDlMultipleMOFailed
EHttpDlCancelTransaction128Internally used download event. Do NOT deal with them.

Enum THttpProgressState

Enumeration indicating download progress state. These enumarated values usually come with EHttpDlInprogress. An exception is EHttpContentTypeReceived that pauses the download until client app accepts and resumes, or deletes/resets it.

EnumeratorValueDescription
EHttpProgNone0
EHttpStarted500
EHttpProgCreatingConnection1000
EHttpProgConnectionNeeded1010
EHttpProgConnected1020
EHttpProgConnectionSuspended1022
EHttpProgDisconnected1030
EHttpProgDownloadStarted2000
EHttpContentTypeRequestedEHttpProgDownloadStarted + 20
EHttpContentTypeReceived

Download status is EHttpDlPaused! Application can check the received content type here and decide whether to accept it or not. Call Start again to carry on download, or Delete to delete this download.

EHttpProgSubmitIssuedEHttpProgDownloadStarted + 30
EHttpProgResponseHeaderReceived2050
EHttpProgResponseBodyReceived
EHttpProgRedirectedPermanently
EHttpProgRedirectedTemporarily
EHttpProgDlNameChanged
EHttpProgContentTypeChanged
EHttpProgCodDescriptorDownloaded2500OMA DD specific progress.
EHttpProgCodDownloadStartedOMA DD specific progress.
EHttpProgCodDescriptorAcceptedCod is accepted.
EHttpProgCodLoadEnd

Cod Handler downloaded the content, but still needs to continue some operation. Call Start again to carry on! Download status is EHttpDlInprogress!

EHttpProgSupportedMultiPart
EHttpProgCodPdAvailable
EHttpProgCodDownloadShouldResume
EHttpProgCodDownloadPause
EHttpProgMovingContentFile3000
EHttpProgContentFileMoved
EHttpContTypeRecognitionAvail
EHttpProgContentFileMovedAndDestFNChanged
EHttpDlProgProgressive
EHttpDlProgNonProgressive

Enum THttpDownloadMgrAttrib

Enums to access session level attributes. Attribute types: string(8/16), TInt32, TBool. Some of them indicated as read-only. In debug mode if the client application tries to write such attribute server panics. In release mode it only returns with KErrArgument. If not specified other, buffer size is KMaxDefAttrLength.

Every 8bits string attribute can be queried into 16bits descriptor. In this case the 8bits buffer is converted into a 16bits one.

EnumeratorValueDescription
EDlMgrAppUid

Unique id of the application passed in Connect. (TInt32 - read only)

EDlMgrIap

Internet Access Point (TInt32 - read/write) (default: default AP used from CommsDb)

EDlMgrExitAction

See THttpDownloadMgrExitAction (TInt32 - read/write) (default: EExitNothing)

EDlMgrSilentMode

No UI interaction in download process (TBool - read/write) (default: EFalse) It is supported only in case of FOTA!!!

EDlMgrMaster

Used if application can be executed in multiple instances (stand-alone and embedded). This flag indicates that this instance, while running, will inherit downloads of all other instances's when they closed. Two masters are forbidden in the same time. (TBool - read/write) (default: EFalse)

EDlMgrAllDlsInMaster

Returns the number of downloads of the Master instance of the application (TInt32 - read-only)

EDlMgrNoMediaDlsInMaster

Returns the number of downloads of the Master instance, those downloads were stored on a media, that media is not present in the phone. (TInt32 - read-only)

EDlMgrConnectionName

Name of the connection to be used to create connection. Or on return it is name of connection used by this instance of download manager. Connection has to be established before this attribute could be returned. Same as RConnection::Name(). Download Manager automatically connects to network with the given name. (String16<KMaxName> - read/write)

EDlMgrAPName

Name of the access point used. Valid only if the IAP id is known by download manager (String16 - read-only) (Not supported on yet!)

EDlMgrNumInprogressDownloads

Number of in-progress downloads of the client. (TInt32 - read-only)

EDlMgrConnected

Returns ETrue if the session have active connection. (TBool - read-only)

EDlMgrNoMediaDls

Returns the number of downloads that are stored on a media that is not present in the phone. (e.g. MMC that is unplugged)

EDlMgrEnableCookies

Client can specify cookie usage in downloads via this attribute. (TBool - read/write) (default: ETrue)

EDlAutoConnect

Connection is automatically created if not exists and this attribute is ETrue. If it's EFalse and no connection, EHttpProgConnectionNeeded is sent to the client. (TBool - read/write) (default: ETrue)

EDlMgrAutoConnectEDlAutoConnect
EDlMgrFotaDownload

Deprecated! Do not use!!! Indicates that it is a FOTA download (TBool - read/write) (default: EFalse)

EDlMgrCodFolder

Folder to store COD contents (String16<KMaxPath> - read-only) (Not supported on yet!)

EDlMgrNumOfClientSideDownload

Number of client side download (TInt32 - read-only)

EDlMgrHasActiveDownloads

Indicates there are unfinished downloads, particularly important during re-start of DownloadMgr after failure of DownloadManager or device

EDlMgrAutoAcceptCod

Tells CODHandler to suppress download confirmation dialog for user acceptance of COD/OMA downloads

EDlMgrProgressiveDownload

Used to control progressiveness of all downoads in a session (TBool - read/write)

Enum THttpDownloadAttrib

Enums to access download specific attributes. Attribute types: string(8/16), TInt32, TBool. Some of them indicated as read-only. In debug mode if the client application tries to write such attribute server panics. In release mode it only returns with KErrArgument. If not specified anyway buffer size is KMaxDefAttrLength.

EnumeratorValueDescription
EDlAttrState

See THttpDownloadState (TInt32 - read-only)

EDlAttrProgressState

See THttpProgressState (TInt32 - read-only)

EDlAttrUserData

Any user defined data that can fit into 32bits (TInt32 - read/write)

EDlAttrId

Unique id of the download. (TInt32 - read-only)

EDlAttrReqUrl100

Requested URL of the content. (String8<KMaxUrlLength> - read/write

EDlAttrRedirUlr

URL after the last permanent redirection. When download is created or reseted it's the same as EDlAttrReqUrl. (String8<KMaxUrlLength> - read-only)

EDlAttrRedirUrlEDlAttrRedirUlr
EDlAttrCurrentUrl

Current URL of the content. It's always updated if transaction redirected (permanently/temporary). (String8<KMaxUrlLength> - read-only)

EDlAttrName

Name of the download. Generated from URL path. If URL doesn't contain filename in the path this name is 'index.html' as per default. (String16<KMaxPath> - read-only)

EDlAttrPort

Port address of the host (TInt32 - read/write) (default: KDefaultPort)

EDlAttrMethod

Do not use it. For internal usage only!!! (TInt32 - read/write)

EDlAttrRequestHeaderAddon

Client application can specify addition request header field with this attribute. Additional header fields cannot override the ones set by Download Manager! Format is: fieldname KColon fieldrawdata [KHttpFieldSeparator fieldname KColon fieldrawdata] Do not insert whitespaces between fieldname and ":" and fieldrawdata! Sample format string: "%S%c%S". (String8 - read/write)

EDlAttrNextBodyData

Returns the next body chunk. (String8<KMaxChunkSize> - read-only) (Not supported on v2.8!)

EDlAttrReleaseBodyData

Retrieving attribute releases memory allocated for body chunk returned in a previous EDlAttrNextBodyData call. On return it indicates that that chunk was the last one. (TBool - read-only) (Not supported on v2.8!)

EDlAttrRedirected

Indicates that temporary redirection occured. Pausing this download is dangerous, because on restart only the original URL, or the last permenently redirected URL is used. It's not guaranteed that HTTP server will provide the same content on restart after a temporary redirection. (TBool - read-only)

EDlAttrResponseHeader

In continue download, client application can pass the received response header via this attribute. Format is the same as in case of EDlAttrRequestHeaderAddon. (String8 - write-only. Accepted only if EDlAttrContinue is ETrue)

EDlAttrRequestHeaderAddonLength

Length of the request header add-on, set by client application. (TInt - read-only)

EDlAttrAuthScheme200

Scheme of authentication. See THttpAuthenticationScheme! (TInt - read/write. Write is accepted only if EDlAttrContinue is ETrue)

EDlAttrRealm

Realm of the HTTP authentication (String8<KMaxRealmLength> - read/write. Write is accepted only if EDlAttrContinue is ETrue)

EDlAttrUsername

User name. (String8 - read/write)

EDlAttrPassword

Password. (String8 - write-only)

EDlAttrProxyRealm

Realm of the proxy authentication. (String8<KMaxRealmLength> - read/write. Write is accepted only if EDlAttrContinue is ETrue)

EDlAttrProxyUsername

User name for proxy authentication. (String8 - read/write)

EDlAttrProxyPassword

Password for proxy authentication. (String8 - write-only)

EDlAttrDestFilename

Destination filename. Content will be moved/renamed here after download completed. Can be set only before Start and after download successfully completed. (String16<KMaxPath> - read/write)

EDlAttrLength

Full size of the content. (TInt32 - read/write. Write is accepted only if EDlAttrContinue is ETrue) (default: KDefaultContentLength - until content size is known)

EDlAttrDownloadedSize

Downloaded size of the content. (TInt32 - read-only)

EDlAttrNoContentTypeCheck

Content is downloaded w/o content type validation. (TBool - read/write) (default: EFalse)

EDlAttrContinueBody

In case of continue download, the client application can pass already received body data to download manager via this attribute. Note that if the download is not started this data is lost, because download manager doesn't persist it until that. It is because it's actually not surely known what the destination file size&name until that. (String8 - write only. Accepted only if EDlAttrContinue is ETrue) (String16 - write only. Accepted only if EDlAttrContinue is ETrue. 8bits data stream stored in 16bits descriptor.)

EDlAttrDestRemovable

Indicates that the content file is stored on a removable media. (TBool - read-only)

EDlAttrStatusCode500

Status code from response header (TInt32 - read-only)

EDlAttrErrorId

See THttpDownloadMgrError (TInt32 - read-only)

EDlAttrGlobalErrorId

Global error id (TInt32 - read-only)

EDlAttrContentType

Content type from response header (String8<KMaxContentTypeLength> - read/write. Write is accepted only if EDlAttrCodDownload is ETrue)

EDlAttrTargetApp

Target app that can open the content (TInt32 - read/write. Write is accepted only if EDlAttrContinue is ETrue)

EDlAttrMediaType

Media type from response header. See RFC2616. (String8<KMaxContentTypeLength> - read-only)

EDlAttrMediaTypeBoundary

Boundary attribute from media type. (String8<KMaxContentTypeLength> - read-only)

EDlAttrAttachmentFileName
EDlAttrDisconnectOnReset1000

Automatic disconnection when Reset called. (TBool - read/write) (default: ETrue)

EDlAttrDisconnectOnPause

Automatic disconnection when Pause called. In progress state EHttpContentTypeReceived download is in paused state but connection is not closed. (TBool - read/write) (default: ETrue)

EDlAttrUnused1
EDlAttrAction

See THttpDownloadMgrAction (TInt32 - read/write) (default: ELaunch )

EDlAttrRestartAction

See THttpRestartActions (TInt32 - read/write) (default: ERestartIfExpired )

EDlAttrNoMedia

ETrue if the media, on which the download is stored, is removed. A Reset clears this flag. (TBool - read only)

EDlAttrContinue

Indicates that download was started in client app but that doesn't handle it. Download is created with RHttpDownloadMgr::CreateClientSideDownloadL(). (TBool - read-only) (default: EFalse)

EDlAttrPausable

If EFalse, download cannot be paused, or the content will be lost. (TBool - read-only) (default: ETrue)

EDlAttrHidden

If true download is NOT shows in the download list or in any way to the user. (TBool - read/write) (default: EFalse)

EDlAttrSilent

No progress events sent to the client application. Only exceptions are: EHttpDlInprogress - EHttpStarted EHttpDlCompleted EHttpDlFailed (TBool - read/write) (default: EFalse)

EDlAttrProgressive

Indicates that this is a progressive download. (TBool - read/write) (default: EFalse)

EDlAttrFotaPckgId

Fota package ID. (TInt32 - read/write) (default: KDefaultFotaPckgId. Default means no FOTA download! )

EDlAttrDownloadNextUrl

This attribute is not supported from 3.0! Beginning from 3.0, Download Manager never downloads the next-uri of OMA/COD downloads automatically, but forwards the next-uri to the client via MHttpDownloadMgrNextUriObserver, then the client can create a new download with the next-uri it has got, if it wants so.

EDlAttrDownloadUpdatedDDUri

If ETrue, updated DD URI is present in download descriptor. Start download with updatd DD URI. (TBool - read/write) (default: EFalse)

EDlAttrUpdatedDDUri

Updated DD URI. (String8<KMaxUrlLength> - read/write

EDlAttrDDType

Content type of the descriptor for OMA downloads. For HTTP this will be content type of the MO (String8<KMaxContentTypeLength> - read only.

EDlAttrHeaderFields1500

Application can set and query raw header fields and values via these attributes. (String<KMaxGeneralHeaderFieldLength> - read/write)

EDlAttrCharSetEDlAttrHeaderFields
EDlAttrResponseCharSetEDlAttrCharSet
EDlAttrResponseAge
EDlAttrResponseETag
EDlAttrResponseLocation
EDlAttrResponseRetryAfter
EDlAttrResponseServer
EDlAttrResponseVary
EDlAttrRequestAccept2000

Request headers

EDlAttrRequestAcceptCharSet
EDlAttrRequestAcceptLanguage
EDlAttrRequestExpect
EDlAttrRequestFrom
EDlAttrRequestHost
EDlAttrRequestMaxForwards
EDlAttrRequestPragma
EDlAttrRequestReferer
EDlAttrRequestUserAgent
EDlAttrRequestVary
EDlAttrEntityAllow2500

Entity header fields

EDlAttrEntityContentEncoding
EDlAttrEntityContentLanguage
EDlAttrEntityContentLocation
EDlAttrEntityExpires
EDlAttrEntityLastModified
EDlAttrGeneralCacheControl3000

General header fields

EDlAttrGeneralDate
EDlAttrGeneralPragma
EDlAttrGeneralVia
EDlAttrGeneralWarning
EDlAttrSucceeded8192

Internally used attribute! Do NOT use!

EDlAttUnused2

Internally used attribute! Do NOT use!

EDlAttrFailed

Internally used attribute! Do NOT use!

EDlAttrCodDownload

Indicates that it is an OMA DD downlad, and the content is downloaded by COD Handler. (TBool - read-only) (default: EFalse)

EDlAttrHashedMsgBody

Internally used attribute! Do NOT use!

EDlAttrDefaultEvent

Internally used attribute! Do NOT use!

EDlAttrRedirectedTemporary

Internally used attribute! Do NOT use!

EDlAttrRedirectedPermanently

Internally used attribute! Do NOT use!

EDlAttrCodDescriptorAccepted

Internally used attribute! Do NOT use!

EDlAttrCodLoadEnd

Internally used attribute! Do NOT use!

EDlAttrDiskBufferingSize

Indicates how large a buffer (in bytes) to use when writing this download to disk. A value of 0 indicates no buffering.

EDlAttrCodPdAvailable

Internally used attribute! Do NOT use!

EDlAttrLocalFileName
EDlAttrCodPausable

Internally used attribute! Do NOT use! Would update the server about Pausability of COD Download. This attribute is only used for COD downloads to update pause attibure in server (TBool - write only)

EDlAttrDdFileName
EDlAttrActiveDownload

For storing DD File name.

EDlAttrActivePlayedDownload
EDlAttrNumMediaObjects
EDlAttrMultipleMOLength

specifies total length of all MOs for the download. (TInt32 - read/write.

EDlAttrMultipleMODownloadedSize

current downloaded size (the sum of downloaded size of all completed MOs. Completed MOs can be successful/failed/paused MOs). . (TInt32 - read-only)

EDlAttrAlbumName

Name of the album. In case of non-album download, this is the download name. (String16<KMaxPath> - read-only)

EDlAttrClientSideDownload
EDlAttrIncrementEventPriorityFlag
EDlAttrCleanupTransaction

Enum THttpMethod

See RFC2616.

EnumeratorValueDescription
EMethodGET
EMethodPOST
EMethodHEAD

Enum THttpAuthenticationScheme

Authentication scheme

EnumeratorValueDescription
EAuthBasicBasic authentication scheme.
EAuthDigestDigest authentication scheme.

Enum THttpDownloadMgrExitAction

This attribute specifies what Download Manager do with the downloads on exit.

EnumeratorValueDescription
EExitNothingDownloads remain intacted on exit (default).
EExitPauseAll downloads paused on exit.
EExitDeleteAll downloads deleted on exit.

Enum THttpDownloadMgrAction

The action to do when a download completes.

EnumeratorValueDescription
EDoNothing0

Do nothing when download completed.

EMove0x0001

Automatically move content to the location pointed by EDlAttrDestFilename

ELaunch0x0002

Automatically lauch target application when download completed. This is the default if not set (default).

EPdLaunch0x0004

Automatically lauch progressive download

Enum THttpRestartActions

Restart actions.

EnumeratorValueDescription
ERestartIfExpired

Download content again if content is expired (default).

ERestartNoIfCompleted

(Re)Start completes with EHttpDlCompleted at once if already completed. Anyway starts to download the content only if it's not modified since last partial download. Restarted anyway. No content update/expiry check.

ERestartForced

Forced download. Don't matter if content is expired, or not.

Enum THttpDownloadMgrError

Allocated usable error range: -30421 -> -30470 (includes the 1st and last numbers).

EnumeratorValueDescription
ENoError0
EGeneral-30421Non-download specific error. See global error code.
EInternal-30422

Internal error occured. Most probably a programming error. (e.g. download that is stored on a media, that is not present in the phone, cannot be started)

EContentFileIntegrity-30423

Content file is missing or has different size then it should be. EDlAttrNoMedia is ETrue if the media, on which content file was (partially) stored, removed.

EDiskFull-30424Not enough disk space for the content.
EConnectionFailed-30425

Most probably IAP id was wrong or no network coverage. For more specific info about the error see EDlAttrGlobalErrorId.

ETransactionFailed-30426

Error occured in the transaction. For more specific info about the error see EDlAttrGlobalErrorId.

EMoveFailed-30427

Moving content file failed. See EDlAttrGlobalErrorId for specific reason.

EDestFileWriteFailed-30428Destination file write failed.
EMMCRemoved-30429MMC card, where th download is being persisted, removed.
EBadUrl-30430
Download Manager cannot handle this URL:
  • it's too long

  • malformed.

EWrongDestFilename-30431Error in destination filename. Most probably not a real filename.
EDestFileInUse-30432

Destination file cannot be opened/created. It's most probably in use by other app. or download.

EHttpUnhandled-30433

Unhandled HTTP error code. See it in EDlAttrGlobalErrorId.

EHttpAuthenticationFailed-30434

401 - Client has to set username/password and Start download again.

EProxyAuthenticationFailed-30435

407 - Client has to set proxy username/password and Start download again.

EObjectNotFound-30436

404 - Object not found.

EPartialContentModified-30437

412: partial content cannot be downloaded because it's already modified. Call Reset or set THttpRestartActions::ERestartForced

EContentExpired-30438

Paused content is expired, or content is modified between two requests. Call Reset() or see THttpRestartActions.

EHttpRestartFailed-30450

Resuming progressive download failed.