Microsoft KB Archive/300469

= How To Use Internet Publishing Provider to Upload Files in IIS =

Article ID: 300469

Article Last Modified on 9/7/2004

-

APPLIES TO

 Microsoft ActiveX Data Objects 2.5, when used with:  Microsoft Windows 2000 Standard Edition

 Microsoft Windows NT 4.0  Microsoft ActiveX Data Objects 2.6, when used with:  Microsoft Windows 2000 Standard Edition

 Microsoft Windows NT 4.0</li></ul> </li> Microsoft Internet Information Server 4.0</li> Microsoft Internet Information Services 5.0</li></ul>

-

<div class="notice_section">

This article was previously published under Q300469

<div class="notice_section">

<div class="notice_section">

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

<div class="summary_section">

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

How to Use the Internet Publishing Provider to Upload Files
<ol> Open Internet Services Manager. To open Internet Services Manager on a computer that is running Microsoft Windows 2000, follow these steps: <ol style="list-style-type: lower-alpha;"> From the Windows Start menu, point to Programs, and point to Administrative Tools.</li> Click Internet Services Manager to open the Internet Services Manager (ISM) console on your Web server.</li></ol>

To open Internet Service Manager on a computer that is running Microsoft Windows NT 4.0, follow these steps: <ol style="list-style-type: lower-alpha;"> From the Windows Start menu, point to Programs, point to Windows NT 4.0 Option Pack, and then click Microsoft Internet Information Server.</li> Click Internet Service Manager.</li></ol> </li> 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.</li> In Visual Basic, create a new Standard EXE project. Form1 is added to the project by default.</li> From the Project menu, click References, 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> 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 your file has been uploaded.</li></ol>

back to the top

Keywords: kbhowto kbhowtomaster KB300469

-

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

© Microsoft Corporation. All rights reserved.