Microsoft KB Archive/217425

= A Simple ASP Example Using Posting Acceptor =

Article ID: 217425

Article Last Modified on 6/23/2005

-

APPLIES TO


 * Microsoft Internet Information Server 4.0

-



This article was previously published under Q217425



We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

http://www.microsoft.com/technet/security/prodtech/IIS.mspx



SUMMARY
Microsoft Posting Acceptor is a server add-on component in the Windows NT Option Pack (NTOP) that enables the use of HTTP Post (RFC 1867) to publish content to your Web site.



MORE INFORMATION
To get Posting Acceptor to work with as few steps as possible, perform the following steps:  Install Posting Acceptor using one of the following methods:

 Install Posting Acceptor during the NTOP installation. -OR-

 Run the NTOP setup and specify Add/Remove.  In either of the above methods, specify the installation of Posting Acceptor, by doing the following:

 Select Microsoft Site Server Express 2.0.</li> Click Show Subcomponents.</li> Select Publishing - Posting Acceptor.</li> Click OK and complete the wizard.</li></ol> </li> Verify that the Cpshost.dll file is in your Scripts folder.</li> Create a new directory named Uploads and give it at least NTFS Add permissions to valid users, but ensure that the "Everyone" and IUSR_COMPUTERNAME accounts do not have rights to the folder.</li> Create a new virtual directory that points to the new Uploads directory with write access.</li>  Create a new text file named Postacpt.asp in your Scripts folder and paste the following HTML code into it: <SCRIPT RUNAT=SERVER LANGUAGE="JavaScript"> if (Request.ServerVariables("LOGON_USER") == '') Response.Status('401 Access Denied'); </SCRIPT> <form enctype="multipart/form-data" action="/scripts/cpshost.dll?PUBLISH" method="POST"> File to upload <input name="file" type="file" size="20"> Destination URL <input name="TargetURL" value="/uploads/" size="20"> <input type="Submit" value="Upload...">

Notes on the above code sample:

 The JavaScript code forces a browser to authenticate. You can remove this code to allow anonymous posting, otherwise you will need to add users/groups as specified in the step above.</li> The form uses a new input of type "file" that should display a Browse button on the Web page.</li></ul> </li> Browse the page at "http://localhost/scripts/postacpt.asp" and upload a file to verify the correct functionality.</li></ol>

For additional information, see the following article or articles in the Microsoft Knowledge Base:

184352 HOWTO: Upload files to the Internet Information Server

189651 SAMPLE: Uploading a File to IIS Using a Browser

189272 Upload Folders with Write and Execute Access Are Vulnerable

179566 How to Do Anonymous Uploads

Keywords: kbhowto KB217425

-

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

© Microsoft Corporation. All rights reserved.