Microsoft KB Archive/305724

= How To Use Internet Publishing Provider to Upload Files in Windows XP =

Article ID: 305724

Article Last Modified on 9/13/2006

-

APPLIES TO


 * Microsoft ActiveX Data Objects 2.5, when used with:
 * Microsoft Windows XP Professional
 * Microsoft ActiveX Data Objects 2.6, when used with:
 * Microsoft Windows XP Professional

-



This article was previously published under Q305724



&quot;Formal product support for Microsoft Windows XP will be available from Microsoft beginning October 25, 2001. Until then, you can consult with your counterparts, peers, and Microsoft Most Valuable Professionals (MVPs) by using our online newsgroups. Access to the Microsoft newsgroups is available from the following Microsoft Web site:

http://www.microsoft.com/communities/newsgroups/default.mspx

&quot;



IN THIS TASK
SUMMARY
 * How to Use the Internet Publishing Provider to Upload Files



SUMMARY
This article demonstrates how to use Internet Publishing Provider to upload files.

back to the top

How to Use the Internet Publishing Provider to Upload Files
 Open Internet Services Manager. To open Internet Services Manager on a computer that is running Microsoft Windows XP, follow these steps:  From the Windows Start menu, point to Programs, and point to Administrative Tools. Click Internet Services Manager to open the Internet Services Manager (ISM) console on your Web server.  In Internet Services Manager, right-click the default Web site, point to New, and then click Virtual Directory. Name the new virtual directory Upload. Complete the steps in the wizard to set up the new virtual directory. In Microsoft Visual Basic, create a new Standard EXE project. Form1 is added to the project by default.</li> From the Project menu, click References, and select the Microsoft ActiveX Data Objects 2.6 check box.</li>  Paste the following code onto the Declarations section of Form1: Option Explicit Private Sub Form_Load Dim objStream As ADODB.Stream Dim objRecord As ADODB.Record Dim strUrl As String, strFile As String strUrl = &quot;http://local/Upload&quot; strFile = &quot;test2.txt&quot; Set objRecord = New ADODB.Record Set objStream = New ADODB.Stream objRecord.Open strFile, &quot;URL=&quot; + strUrl, adModeReadWrite, _ adCreateOverwrite, adDelayFetchStream objStream.Type = adTypeBinary objStream.Open objRecord, adModeReadWrite, adOpenStreamFromRecord objStream.LoadFromFile &quot;C:\test.txt&quot; objStream.Flush objStream.Close objRecord.Close Set objStream = Nothing Set objRecord = Nothing End Sub </li> In the preceding code, change the value of strURL to the appropriate Web site URL.</li> Press the F5 key to run the project.</li> Open the Internet Information Services console again, and look in the Upload virtual directory. Notice that your file has been uploaded.</li></ol>

back to the top

Keywords: kbhowto kbhowtomaster KB305724

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.