Web API Specification for the
OTC Reporting Facility
File Downloads - ORF
Version 6.0
October 16, 2014
2
Revision History Version/Date Changes Made
Version 1.0; 2/10/2014 Original version of specification
Version 2.0; 3/19/2014 Changes are described in Appendix A –
Version 2.0 Summary of Changes
Version 3.0; 4/22/2014 Add field length (14) for FINRA_OTC_ID;
Change field length from 11 to 15 bytes
for: ADR_ORDNY_SHARE_RT; OLD
ADR_ORDNY_SHARE_RT; and NEW
ADR_ORDNY_SHARE_RT
Version 4.0; 6/10/2014 CLASS_TX Description – Relates to Class
or Series of Security
SUBJ_CRPRT_ACTN_CD – Values
changed from Y/N to CA/CD
Appendix B - Included table of values for
DAILY_LIST_RSN_CD
Version 5.0; 9/9/2014 Added value definitions for Offering Type
(OFRNG_TYPE_CD)
Added value definitions for Financial
Status Indicator (FNNCL_STTS_CD)
Defined field as ratio for ADR to Ordinary
Share Ratio (ADR_ORDNY_SHARE_RT)
Defined field as ratio for Forward Split
Ratio (FRWRD_SPLIT_RT) and Reverse
Split Ratio (RVRS_SPLIT_RT)
Added Daily List Reason Codes in
Appendix B and Descriptions, RSFS:
SCAFR; F1534
Added Appendix C – Equity Master
Security Code Descriptions
(SCTRY_TYPE_CD) table
Version 6.0; 10/16/2014 Added Daily List Reason Code FSCL
(Financial Status Change Liquidation)
Modified Equity Master Security Type
Code Description of Preferred Stock from
PRES to PRFS
Added Corporate Actions statement related
to the potential inclusion of fixed income
data in the Daily List
Introduction
The FINRA Trade Reporting and Quotation Service (TRAQS™) is a system developed by FINRA in
order to facilitate the various fixed income and equity reporting facilities FINRA currently maintains
(e.g., TRACE, TRF, ADF, OTC Equity Reporting, etc…) into a single platform.
3
The TRAQS Download domain supports client needs via Web Application Programming Interface (API)
to download the security master and other files.
Access to the file domain
Equity file downloads use the NASDAQ Web Security Framework (NWSF) for authentication (proper
client authorization for access to particular files must be in place). In order to access the site and
download files, a user needs to present a valid NWSF account/password and client certificate with access
to the application.
The Security Master is maintained by FINRA Operations. For questions concerning the data in this file,
or to subscribe to receive the file, please contact FINRA Operations at (866) 776-0800 or
[email protected]. For technical questions or issues accessing the file, please contact FINRA
Product Management at (866) 899-2107 or [email protected].
Corporate Actions:
FINRA reviews and processes documents relating to announcements for company-related actions
pursuant to Rule 10b-17SEC (SEA) for both equity and fixed income securities. These documents
include both equity and fixed income announcements of dividends or other distributions in cash or in kind,
except an ordinary interest payment on debt security. In addition, Uniform Practice Code (“UPC”),
section 11150 (a&b) prescribes the steps for the establishment of “Ex-Interest” for all transactions, except
“cash”, in bonds or similar evidences of indebtedness which are traded "flat". Therefore, Daily List
information included as a result of a query may include both equity and fixed income data related to these
corporate actions.
4
Protocol
FINRA’s download site provides access to all of the files using standard HTTP Secure (https) protocol. It
is a combination of the Hypertext Transfer protocol and the TLS protocol to provide encrypted
communications and secure identification. The URL https://download.finratraqs.org is the domain where
the file resides. In order to access file reference data users should refer to the query string detailed in the
specification.
File availability – all times are approximate
File Time
Start of day security master file; participant master
file; daily list participant; clearing number
relationship file; participant agreements file;
explicit fee agreement file; daily list security file
7:00 a.m. ET; and available throughout the day on
a near-real time basis.
Final possible file updates 8:00 p.m. ET
Users may attempt to access the files on non-business days; however, due to server maintenance which
occurs on weekends and other non-business days it is possible the user will not have immediate success in
accessing the data during these days.
5
URL Parameters
Parameter Parameter Options
Action DOWNLOAD - provide the file.
DELTA – provide the changes since the last time the user downloaded the file.
Delta actions are supported for Security Daily List and Participant Daily List
files.
Facility ORF
Files
EQUITYMASTERAC – Equity Security Master File Active issues
EQUITYMASTERIN –Equity Security Master File Inactive issues
DAILYLIST – Security Daily List for OTC Reporting Facility
PARTICIPANT – Equity Participant Master File
PDAILYLIST– Equity Participant Daily List
EQUITYCLEAR – Equity Clearing Relationship File
EQUITYUSA – Equity US Agreements File
EXPLICITFEE – Explicit Fee Agreement File
All files are pipe delimited.
File Query Parameters
Equity Security Master
– Active issues
action=DOWNLOAD&file=EQUITYMASTERAC&facility=ORF
Equity Security Master
– Inactive issues
action=DOWNLOAD&file=EQUITYMASTERIN&facility=ORF
Equity Participant
Master
action=DOWNLOAD&file=PARTICIPANT&facility=ORF
Equity Participant Daily
List
action=DOWNLOAD&file=PDAILYLIST&facility=ORF
Equity Participant Daily
List delta
action=DELTA&file=PDAILYLIST&facility=ORF
Equity Clearing
Relationship
action=DOWNLOAD&file=EQUITYCLEAR&facility=ORF
Equity US Agreements action=DOWNLOAD&file=EQUITYUSA&facility=ORF
Explicit Fee action=DOWNLOAD&file=EQUITYEXPLICITFEE&facility=ORF
Security
Daily List delta
(See note 1)
action=DELTA&file=DAILYLIST&facility=ORF
Security
Daily List for a specific
day
action=DOWNLOAD&file=DAILYLIST&facility=ORF&day=11/17/2014
6
ORF - Equity Security Master File (Active and Inactive issues)
Field Name (Header) Description Comments Maximum
Length
FINRA_OTC_ID FINRA OTC Security ID
Symbol
Security Id generated by
FINRA RDMS System.
14
CUSIP_ID CUSIP This field will be blank
for firms that do not have
a CUSIP license in place.
9
SYM_CD Security Symbol Local exchange symbol. 14
SYM_SUF_CD Symbol Suffix 7
SCRTY_DS Security Description Security
Description/Name.
250
RND_LOT_QT Round Lot Size Min. number of shares
that can be purchased
without incurring a larger
fee.
4
CPN_RT Coupon Rate 6
DTC_ELGBL_FL DTC Eligibility Flag Indicates if security is
eligible to be delivered
through a computerized
system established by
DTCC.
1
SCRTY_TYPE_CD Security Type Security Type
Description.
4
WIS_DSTRD_CD When Issued Flag Indicates if the security
does not have a firm
settlement. WI or WD.
2
STTS_CD Status Code Indicates if security is
active, inactive or
terminated.
1
NACTV_DT Inactive date and time Format is
YYYYMMDDHHMMSS
14
TEST_SCRTY_FL Test Security Flag to
indicate whether the
security is used for
testing. Default value
will be ‘N”
1
PRICE_CK_FL Price Check Flag 1
SCRTY_EFCTV_TS Security effective time
stamp
Format is
YYYYMMDDHHMMSS
14
SIP_SYM_ID SIP Symbol 21
OTCBB_QUOTE_FL Y or N 1
CLASS_TX Class or Series of
Security
2
OFRNG_TYPE_CD Offering Type A – 144A
S – Reg S
B – 144A and Reg S
N – No Restrictions
1
7
Field Name (Header) Description Comments Maximum
Length
MTRTY_XPRTN_DT Maturity/Expiration date Format is
YYYYMMDDHHMMSS
14
NSCC_ELGBL_FL NSCC Clearing Eligible
Flag
1
DSMTN_FL Dissemination Flag 1
SUBJ_CRPRT_ACTN_CD Subject to Corporate
Action
CA – Corporate Action
without a distribution
CD – Corporate Action
with a distribution
2
ADR_ORDNY_SHARE_RT ADR to Ordinary Share
Ratio
Ratio 15
BRKR_PRTCT_PRD_FL Broker Protect Period
Flag
1
PGYBK_ELGBL_FL Piggyback Eligible Flag The OTCBB security has
been quoted for at least
12 business days during
the preceding 30 calendar
days, with no more than
four business days in
succession without a
quotation. When the
security is piggyback
eligible, any participant
may quote the security on
the OTCBB without a
211 submission.
• Y (Piggyback Eligible)
• N (Not Piggyback
Eligible)
1
REG_FEE_FL Reg Fee Flag N if Offering Type
is144A or 144A and Reg
S; Y if Offering Type is
No Restrictions or Reg S
1
REG_SHO_FL Reg SHO Flag 1
RULE_4320_FL 4320 Flag 1
OATS_RPTBL_FL OATS Flag 1
FNNCL_STTS_CD Financial Status Indicator E - Delinquent
Q – Bankrupt
J - Delinquent and
Bankrupt
L - Liquidation
H -Liquidation and
Delinquent
M -Bankruptcy
Reorganization
(Emerged)
1
8
Field Name (Header) Description Comments Maximum
Length
LAST_UPDT_TS Timestamp value when
record was created
Format is
YYYYMMDDHHMMSS
14
9
ORF Daily List (for Securities)
Field Name (Header) Description Comments Maximum
Length
DAILY_LIST_TS Daily List Date/Time YYYYMMDDHHMMSS
format.
14
DAILY_LIST_EVENT_CD Daily List Event Type Valid values are:
SA - Security Addition
SC – Security Change
SD – Security Deletion
DA – Dividend Addition
DC – Dividend Change
DD– Dividend
Deletion/Cancellation
Note: for corporate actions
where the security attribute
changes and a distribution is
announced (i.e., Forward
Split, Reverse Split, Stock
Dividend or Split, Reverse
Split followed by Forward
Split), the Change Type shall
be Dividend Addition.
2
OLD_SYM_CD Old Symbol 14
NEW_SYM_CD New Symbol 14
OLD_CUSIP_ID Old Cusip 9
NEW_CUSIP_ID New Cusip 9
OLD_SCRTY_DS Old Security
Description
250
NEW_SCRTY_DS New Security
Description
250
OLD_FNNCL_STTS_CD Old Financial Status
Indicator
1
NEW_FNNCL_STTS_CD New Financial Status
Indicator
1
OLD_OATS_RPTBL_FL Old OATS
Reportable Flag
1
NEW_OATS_RPTBL_FL New OATS
Reportable Flag
1
10
OLD_RND_LOT_QT Old Unit of Trade 4
NEW_RND_LOT_QT New Unit of Trade 4
OLD_CLASS_TX Old Class or Series of
Security
2
NEW_CLASS_TX New Class or Series of
Security
2
OLD_ADR_ORDNY_SHARE_RT Old ADR Ratio Ratio 15
NEW_ADR_ORDNY_SHARE_RT New ADR Ratio Ratio 15
OLD_REG_FEE_FL Old Reg Fee Flag 1
NEW_REG_FEE_FL New Reg Fee Flag 1
OLD_MTRTY_XPRTN_DT Old Maturity Date YYYYMMDDHHMMSS
format.
14
NEW_MTRTY_XPRTN_DT New Maturity Date YYYYMMDDHHMMSS
format.
14
OLD_MKT_CTGRY_CD Old Market Category Code U – OTCBB
u – Other OTC
1
NEW_MKT_CTGRY_CD New Market Category Code U – OTCBB
u – Other OTC
1
OFRNG_TYPE_CD Offering Type A – 144A
S – Reg S
B – 144A and Reg S
N – No Restrictions
1
SUBJ_CRPRT_ACTN_CD Subject to Corp Action CA – Corporate Action
without a distribution
CD – Corporate Action
with a distribution
2
DCLRN_DT Declaration Date YYYYMMDDHHMMSS
format.
14
PYMNT_DT Payment Date YYYYMMDDHHMMSS
format.
14
EX_DT This is the “change effective
date”, i.e., the effective date
of the change being
announced on the Daily List
or the Ex Date of the
Dividend.
YYYYMMDDHHMMSS
format.
14
REC_DT Record Date YYYYMMDDHHMMSS
format.
14
FRWRD_SPLIT_RT Forward Split Ratio Ratio 10
RVRS_SPLIT_RT Reverse Split Ratio Ratio 10
STOCK_PT Percentage Decimal 10; 4 after the
decimal
CASH_AMT_TX Cash Amount Decimal 25
PYMNT_MTHD_CD Payment Method 3
11
ADR_FEE_AM ADR Dividend Fee Decimal 10; 4 after the
decimal
ADR_TAX_RLF_AM ADR Tax Relief Fee Decimal 10; 4 after the
decimal
ADR_GROSS_RT ADR Gross Rate Decimal 18; 7 after the
decimal
ADR_NET_RT ADR Net Rate Decimal 18; 7 after the
decimal
ADR_ISSNC_FEE_AM ADR Issuance Fee Decimal 10; 4 after the
decimal
ADR_WHLDG_TAX_PT ADR Withholding Tax Decimal 10; 4 after the
decimal
QLFD_CD Qualified Dividend Code 1
DAILY_LIST_RSN_CD Change Reason Description Refer to Appendix B for
values and descriptions
5
CMMNT_TX Comments 500
ORF - Equity Participant Master File
Field Name
(Header)
Description Comments Maximum Length
MPID Market Participant Identifier FINRA identifier assigned
to the participant.
6
DBA_NM Firm Name 64
12
ORF - Equity Participant Daily List
Field Name
(Header)
Description Comments Maximum Length
list_dt Daily List Date Format is
MMDDYYYY
effective_dt Effective Date Format is
MMDDYYYY
cd_description Event Type Valid values are:
Participant Addition
Participant Deletion
Participant Change
old_mpid Market Participant Identifier 6
old_dba Firm Name 64
new_mpid New Market Participant
Identifier
6
new_dba New Firm Name 64
rf_cd Reporting Facility Value will always be ORF
ORF - Equity Clearing Relationship File
Field Name
(Header)
Description Comments Maximum Length
MPID MPID of the Client FINRA identifier assigned
to the participant.
6
CLRG_ORG_NB Clearing Number of Clearing
Org used by the MPID
5
CLRG_FIRM_NM Clearing Firm Name Name of Clearing Firm
Organization.
64
CLRG_EFCTV_DT Clearing Relationship
Effective Date
Format is
YYYYMMDDHHMMSS
14
CLRG_XPRTN_DT Clearing Relationship
Expiration Date
Format is
YYYYMMDDHHMMSS
14
PRMRY_CLRG_FL Default Clearing
Relationship flag
Value will be Y or N to
state if the clearing
number in this record is
the default clearing
number.
1
13
ORF - Equity US Agreements File
Field Name (Header) Description Comments Maximum
Length
MPID MPID of the Client FINRA identifier assigned
to the participant.
6
AGRMT_EFCTV_DT Effective Date for the
agreement with the
client
Format is
YYYYMMDDHHMMSS
14
AGRMT_XPRTN_DT End date for
agreement with the
client
Format is
YYMMDDHHMMSS
12
UNFRM_SRVC_AGRMT_MP_ID MPID of client with
who agreement is
based
FINRA identifier assigned
to the participant.
6
US_GIVEUP_DROP_FL Give Up firm
receives drop copies
of transaction
messages
Y or N.
ORF – Explicit Fee File
Field Name (Header) Description Comments Maximum
Length
MPID_1 MPID of the Client FINRA identifier assigned
to the participant.
6
CLRG_FIRM_NM_1 Clearing Firm Name
for first MPID
Name of Clearing Firm
Organization.
64
MPID_2 MPID of Client 2 in
file
FINRA identifier assigned
to the second participant.
6
CLRG_FIRM_NM_2 Clearing Firm Name
for second MPID
Name of Clearing Firm
Organization for second
participant.
64
AGRMT_EFCTV_DT Effective Date for the
agreement with the
client
Format is
YYYYMMDDHHMMSS
14
AGRMT_XPRTN_DT End date for
agreement with the
client
Format is
YYMMDDHHMMSS
12
14
Example Requests
Example - Get the current active Equity Security Master file
https://download.finratraqs.org/DownloadHandler.ashx?action=DOWNLOAD&file=
EQUITYMASTERAC&facility=ORF
Example - Get the current Equity Participant Master file
https://download.finratraqs.org/DownloadHandler.ashx?action=DOWNLOAD &file=
PARTICIPANT&facility=ORF
Example - Get the current Equity Clearing Relationship Master file
https://download.finratraqs.org/DownloadHandler.ashx?action=DOWNLOAD &file=
EQUITYCLEAR&facility=ORF
Example - Get the current Equity US Agreements Master file
https://download.finratraqs.org/DownloadHandler.ashx?action=DOWNLOAD &file=
EQUITYUSA&facility=ORF
Example - Get the current Explicit Fee file
https://download.finratraqs.org/DownloadHandler.ashx?action=DOWNLOAD &file=
EQUITYEXPLICITFEE&facility=ORF
15
Appendix A – Version 2.0 Summary of Changes:
Version 2.0 changes
EQUITY SECURITY MASTER FILE
Previous Field Name New Field Name Previous Maximum Length
New Maximum Length
FINRA_EQTY_ID FINRA_OTC_ID
(FIELD ADDED) SYM_SUF_CD 7
CPN_RT 28 6
WIS_DIS_CD WIS_DSTRD_CD
SUBJ_CRPRT_ACTN_FL SUBJ_CRPRT_ACTN_CD 1 2
ORDNY_ADR_RT ADR_ORDNY_SHARE_RT
4320_FL RULE_4320_FL
(FIELD ADDED) OATS_RPTBL_FL 1
(FIELD ADDED) FNNCL_STTS_CD 1
TS LAST_UPDT_TS
DAILY LIST FILE
Previous Field Name New Field Name Previous Maximum Length
New Maximum Length
DAILY_LIST_EFCTV_TS DAILY_LIST_TS
OLD_FNNCL_STTS_DS OLD_FNNCL_STTS_CD 50 1
NEW_FNNCL_STTS_DS NEW_FNNCL_STTS_CD 50 1
OLD_ORDNY_ADR_RT OLD_ADR_ORDNY_SHARE_RT
NEW_ORDNY_ADR_RT NEW_ADR_ORDNY_SHARE_RT
OLD_XPRTN_DT OLD_MTRTY_XPRTN_DT
NEW_XPRTN_DT NEW_MTRTY_XPRTN_DT
OFRNG_TYPE_DS OFRNG_TYPE_CD 50 1
SUBJ_CRPRT_ACTN_DS SUBJ_CRPRT_ACTN_CD 50 2
SPLIT_FCTR_RT FRWRD_SPLIT_RT 11 10
(FIELD ADDED) RVRS_SPLIT_RT 10
STOCK_PT 11 10
CASH_DVDND_AM CASH_AMT_TX 11 25
ADR_FEE_AM 11 10
ADR_TAX_RLF_AM 11 10
ADR_GRSS_RT ADR_GROSS_RT 11 18
ADR_NET_RT 11 18
ADR_ISSNC_FEE_AM 11 10
ADR_WTHLD_TAX_AM ADR_WHLDG_TAX_PT 11 10
QLFD_DVDND_DS QLFD_CD 50 1
DAILY_LIST_RSN_DS DAILY_LIST_RSN_CD 50 5
DVDND_TYPE_CD (FIELD DELETED) 2
DVDND_NON_ADR_FL (FIELD DELETED) 1
DVDND_ADR_FL (FIELD DELETED) 1
16
Added - Equity Participant Daily List Data Layout
Field Name
(Header)
Description Comments Maximum Length
list_dt Daily List Date Format is
MMDDYYYY
effective_dt Effective Date Format is
MMDDYYYY
cd_description Event Type Valid values are:
Participant Addition
Participant Deletion
Participant Change
old_mpid Market Participant Identifier 6
old_dba Firm Name 64
new_mpid New Market Participant
Identifier
6
new_dba New Firm Name 64
rf_cd Reporting Facility Value will always be ORF
17
Appendix B – Daily List Reason Code Descriptions:
Daily List Reason Code –
DAILY_LIST_RSN_CD
Daily List Reason Code Description
12J 12(j)Registration Revoked by SEC
ADD Addition
AMM Acquisition/Merger/Amalgamation
BCSHD Bankruptcy Cash Distribution
BPESC Bankruptcy Plan Effective/Shares Cancelled
BSD Bankruptcy Plan Effective Shares
Cancelled/Distribution
BSTKD Bankruptcy Stock Distribution
CALLD Called
CCD Charter Cancelled/Dissolution
CDR Cash Dividend Regular
CDRS Cash Dividend Regular and Special
CDS Cash Dividend Special
CNVRC Conversion/Reclassification
CSDR Cash and/or Stock Dividend Regular
CSDRS Cash and/or Stock Dividend Regular and Special
CSDS Cash and/or Stock Dividend Special
CSPCD CUSIP Change
CSPSP CUSIP Suspended
DCSHD Default Interest (Cash) Distribution
DSTKD Default Stock Distribution
F6530 Failure to Comply with FINRA Rule 6530
FS Forward Split
FSCCD Forward Split/CUSIP Change
FSCE Financial Status Change Delinquent = E
FSCJ Financial Status Change Bankrupt and Delinquent
= J
FSCL Financial Status Change Liquidation = L
FSCLD Financial Status Change Liquidation and
Delinquent = H
FSCM Financial Status Change Bankruptcy
Reorganization (Emerged) = M
FSCQ Financial Status Change Bankruptcy = Q
IN Ineligible
LFD Liquidation/Final Distribution
MATCD Maturity Date Change
MATEX Matured/Expired
MC Market Center Change
NACTV Inactive Security
NMCCD Name/CUSIP Change
NMCHG Name Change
NMSMC Name/Symbol/CUSIP Change
NMSYM Name/Symbol Change
NQT Ineligible for Quotation on OTCBB due to quoting
inactivity under SEC Rule 15c-211
O Other
18
PRVTN Company Going Private
RDMPT Redemption
RSFS Reverse Split followed by Forward Split
RSCCD Reverse Split/CUSIP Change
RSFFS Reverse Split followed by Forward Split/CUSIP
Change
RSTMT Reinstatement
SDPAS Stock Dividend Payable in Another Security
SDR Stock Dividend Regular
SDRS Stock Dividend Regular and Special
SDS Stock Dividend Special
SO Spin-Off
SCAFR Subject to Corporate Action Flag Removed
SYMCD Symbol Change
TERMD ADR/GDR Program Terminated
TO Tender Offer
F1534 Terminated Registration under the 34 Act
US Unit Separation
XCHG Exchanged
XR Ex Rights
XTRDH Extended Trading Halt
XW Ex Warrants
Appendix C – Equity Master Security Type Cd Descriptions:
Security Type Code – SCTRY_TYPE_CD Security Type Code Description
ADRS American Depository Receipts – Sponsored
ADRU American Depository Receipts – Unsponsored
ADSS American Depository Shares – Sponsored
ADSU American Depository Shares – Unsponsored
CERT Trust Certificates
CMSH Common Shares
COMS Common Stock
DPRT Depository Receipts
DPSH Depository Shares
ETF Exchange Traded Fund
FETF Foreign Exchange Traded Fund
GBDR Global Depository Receipts – Sponsored
GBDS Global Depository Shares – Sponsored
GBRU Global Depository Receipts – Unsponsored
GBSU Global Depository Shares - Unsponsored
LQTR Liquidating Trust
LTDP DPP/Limited Partnership
MGFS Managed Fund Shares
ORDY Ordinary Fund Shares
OTHR Other
PREF Preference Shares
PRFS Preferred Stock
19
REIT REIT
RTCL Rights Contingent Litigation
RTCU Rights Currency
RTCV Contingent Value Rights
RTOT Rights
TRST Shares of Beneficial Interest
UNOT Unit
WRCL Warrant Contingent Litigation
WRCU Warrant Currency
WROT Warrant
20
Appendix D
Programmatic Access (C#, .NET example)
The following is a code excerpt to illustrate how to use the MPP Download site programmatically. If you
are going to access the site with an application the first step is to download the NWSF client certificate
using your web browser. Install it in the browser then export the certificate from the browser, saving the
certificate to a location on the machine as an X905 certificate (.cer).
Example using the active Equity Security Master:
string Action = "DOWNLOAD";
string file = "EQUITYMASTERAC";
string facility = "ORF";
string site = "https:// download.finratraqs.org/DownloadHandler.ashx";
string query = string.Format("{0}?action={1}&file={2}&facility={3}", site,
Action, file, facility);
// Create request
HttpWebRequest webRequest = WebRequest.Create(query) as HttpWebRequest;
// Get cert and add to request
X509Certificate Cert =
X509Certificate.CreateFromCertFile("C:\\MPP\\cert\\mpp_cert.cer");
webRequest.ClientCertificates.Add(Cert);
webRequest.Method = "GET";
// Add nwsf user/password to request
NetworkCredential nwCredentials = new NetworkCredential("user", "pwd");
webRequest.Credentials = nwCredentials;
// Make the request
HttpWebResponse Response = (HttpWebResponse)webRequest.GetResponse();
// Fiddle with the header in the response to get the file name
int pos = Response.Headers["Content-Disposition"].IndexOf("TRACE");
string Filename = Response.Headers["Content-Disposition"].Substring(pos);
// Create a file to save it in ..
StreamWriter sw = new StreamWriter("C:\\MPP\\files\\" + Filename, false);
StreamReader sr = new StreamReader(Response.GetResponseStream(),
Encoding.Default);
int cnt;
char [] ReadBuf = new char[1024];
while ((cnt = sr.Read(ReadBuf, 0, 1024)) != 0)
{
sw.Write(ReadBuf);
}