DOCUMENT:Q222618 24-MAY-2002 [iis] TITLE :Using ASP and User Names with Posting Acceptor PRODUCT :Internet Information Server PROD/VER::4.0 OPER/SYS: KEYWORDS: ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Internet Information Server version 4.0 ------------------------------------------------------------------------------- SUMMARY ======= Microsoft Posting Acceptor is a server add-on component of the Windows NT Option Pack (NTOP) that enables the use of HTTP Post (RFC 1867) to publish content to your Web site. Web administrators and authors using Posting Acceptor in conjunction with Microsoft Active Server Pages (ASP) can automate document publishing by using the logged-on user's name to store files in a virtual directory of the same name. MORE INFORMATION ================ The following steps show how to install Posting Acceptor from the NTOP. Install Posting Acceptor using one of the following two methods: - During the initial NTOP installation -OR- - Running the NTOP setup in maintenance mode and specifying Add/Remove In either of the above scenarios, specify the installation of Posting Acceptor by following these steps: 1. Select Microsoft Site Server Express 2.0. 2. Click Show Subcomponents. 3. Select Publishing - Posting Acceptor. 4. Click OK to continue the wizard. 5. Verify that the Cpshost.dll file is in your Scripts folder. These next steps will walk you through creating a virtual directory to upload files to based on a user name. For this example, "Administrator" account is used; however, any valid user account may be used. 1. Log on to your Windows NT server as "Administrator." 2. Create a new folder on an NTFS drive such as "X:\ADMIN", where X is your drive letter. 3. Open the security settings for the new folder. 4. Grant NTFS Full Control permissions to the "Administrator" and "System" accounts. 5. Remove all other users and groups. 6. Create a new virtual directory that points to the new folder. 7. Open the Internet Services Manager in the MMC. 8. Right-click your default Web site. 9. Click New, and then select Virtual Directory from the pop-up menu. 10. Click Next to start the wizard. 11. Enter "administrator" for the alias and click Next. 12. Browse to the ADMIN folder from earlier and click Next. 13. Select only Read and Write, and then click Next. 14. Click Finish to complete the wizard. Next, copy the following ASP code and save it to your SCRIPTS folder as "Postlogon.asp." This ASP code is actually two HTML form examples on one page. - The first form uses a form text field that is populated with the user's name, but allows the field's contents to be changed. - The second form uses a hidden form field that will also be populated with the user's name, but prevents the field's contents from being changed. <%@LANGUAGE="VBScript"%> <% ' check to see if the user has logged on at all If Request.ServerVariables("LOGON_USER") = "" Then ' force authentication if not Response.Clear Response.Status = "401 Access Denied" Response.End Else ' store the client's user name ins a session variable strLogonUser = Request.ServerVariables("LOGON_USER") ' is this an NT domain logon? If InStr(strLogonUser,"\") then ' strip out an NT domain from the user name if present strLogonUser = Mid(strLogonUser,InStr(strLogonUser,"\")+1) End If End If %>

Logged On User Posting Acceptor Example


Using Visible Form Field
File to upload
Destination URL

Using Hidden Form Field
File to upload

For additional information, please see the following article(s) in the Microsoft Knowledge Base: Q184352 HOWTO: Upload files to the Internet Information Server Q189651 SAMPLE: Uploading a File to IIS Using a Browser Q189272 Upload Folders with Write and Execute Access Are Vulnerable Additional query words: ====================================================================== Keywords : Technology : kbiisSearch kbiis400 Version : :4.0 Issue type : kbhowto ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2002.