Microsoft KB Archive/246884: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - "<" to "<")
Line 62: Line 62:
Use the following steps to workaround this issue.
Use the following steps to workaround this issue.
<ol>
<ol>
<li>Open the Upload.inc file in the &lt;Microsoft Site Server&gt;\SiteServer\Publishing folder.</li>
<li>Open the Upload.inc file in the <Microsoft Site Server&gt;\SiteServer\Publishing folder.</li>
<li><p>Replace the GenerateCommonUploadCode sub with the following:</p>
<li><p>Replace the GenerateCommonUploadCode sub with the following:</p>
<pre class="codesample">Sub GenerateCommonUploadCode
<pre class="codesample">Sub GenerateCommonUploadCode
Line 76: Line 76:
             Response.Write &quot;End If&quot; &amp; CrLf
             Response.Write &quot;End If&quot; &amp; CrLf


             Response.Write &quot;If Version &lt; RequiredVersion Then&quot; &amp; CrLf
             Response.Write &quot;If Version < RequiredVersion Then&quot; &amp; CrLf
             Response.Write &quot;    If confirm(&quot;&quot;This page requires a newer version of VBScript to view. Do you want to upgrade now?&quot;&quot;) Then&quot; &amp; CrLf
             Response.Write &quot;    If confirm(&quot;&quot;This page requires a newer version of VBScript to view. Do you want to upgrade now?&quot;&quot;) Then&quot; &amp; CrLf
             Response.Write &quot;        location.href = &quot;&quot;http://www.microsoft.com/msdownload/scripting.htm&quot;&quot;&quot; &amp; CrLf
             Response.Write &quot;        location.href = &quot;&quot;http://www.microsoft.com/msdownload/scripting.htm&quot;&quot;&quot; &amp; CrLf
Line 93: Line 93:
             Response.Write &quot;    strTemp = Replace(strTemp, &quot;&quot;&amp;&quot;&quot;, &quot;&quot;%26&quot;&quot;)&quot; &amp; CrLf
             Response.Write &quot;    strTemp = Replace(strTemp, &quot;&quot;&amp;&quot;&quot;, &quot;&quot;%26&quot;&quot;)&quot; &amp; CrLf
             Response.Write &quot;    strTemp = Replace(strTemp, &quot;&quot;&gt;&quot;&quot;, &quot;&quot;%3E&quot;&quot;)&quot; &amp; CrLf
             Response.Write &quot;    strTemp = Replace(strTemp, &quot;&quot;&gt;&quot;&quot;, &quot;&quot;%3E&quot;&quot;)&quot; &amp; CrLf
             Response.Write &quot;    strTemp = Replace(strTemp, &quot;&quot;&lt;&quot;&quot;, &quot;&quot;%3C&quot;&quot;)&quot; &amp; CrLf
             Response.Write &quot;    strTemp = Replace(strTemp, &quot;&quot;<&quot;&quot;, &quot;&quot;%3C&quot;&quot;)&quot; &amp; CrLf
             Response.Write &quot;    Length = UBound(FileList)&quot; &amp; CrLf
             Response.Write &quot;    Length = UBound(FileList)&quot; &amp; CrLf
             Response.Write &quot;    ReDim Preserve FileList(Length + 1)&quot; &amp; CrLf
             Response.Write &quot;    ReDim Preserve FileList(Length + 1)&quot; &amp; CrLf
Line 106: Line 106:
             Response.Write &quot;    For I = 0 To UBound(FileList) - 1&quot; &amp; CrLf
             Response.Write &quot;    For I = 0 To UBound(FileList) - 1&quot; &amp; CrLf
             Response.Write &quot;        str = str &amp; &quot;&quot;CMFilename=&quot;&quot; &amp; FileList(I)&quot; &amp; CrLf
             Response.Write &quot;        str = str &amp; &quot;&quot;CMFilename=&quot;&quot; &amp; FileList(I)&quot; &amp; CrLf
             Response.Write &quot;        If I &lt;&gt; (UBound(FileList) - 1) Then str = str &amp; &quot;&quot;&amp;&quot;&quot; &quot; &amp; CrLf
             Response.Write &quot;        If I <&gt; (UBound(FileList) - 1) Then str = str &amp; &quot;&quot;&amp;&quot;&quot; &quot; &amp; CrLf
             Response.Write &quot;    Next&quot; &amp; Crlf
             Response.Write &quot;    Next&quot; &amp; Crlf
             Response.Write &quot;    GetFileListAsURL = str&quot; &amp; CrLf
             Response.Write &quot;    GetFileListAsURL = str&quot; &amp; CrLf

Revision as of 09:00, 21 July 2020

Knowledge Base


Article ID: 246884

Article Last Modified on 12/2/1999



APPLIES TO

  • Microsoft Site Server 3.0 Standard Edition



This article was previously published under Q246884

SYMPTOMS

You cannot upload files that start with a number sign (#) in the Content Management (CM) Sample Site.

CAUSE

The code that is needed to translate the number sign (#) to its hexadecimal ASCII equivalent, 23, is missing.

Response.Write "    strTemp = Replace(strTemp, ""#"", ""%23"")" & CrLf
                

RESOLUTION

Use the following steps to workaround this issue.

  1. Open the Upload.inc file in the <Microsoft Site Server>\SiteServer\Publishing folder.
  2. Replace the GenerateCommonUploadCode sub with the following:

    Sub GenerateCommonUploadCode
        If Not g_fCommonCodeGenerated Then
            If g_fUseActiveX Then
            
                Response.Write "Dim Version, RequiredVersion" & CrLf
                Response.Write "RequiredVersion = 2" & CrLf
                Response.Write "If ScriptEngineMajorVersion = 0 Then" & CrLf
                Response.Write "    Version = 1" & CrLf
                Response.Write "Else" & CrLf
                Response.Write "    Version = ScriptEngineMajorVersion" & CrLf
                Response.Write "End If" & CrLf
    
                Response.Write "If Version < RequiredVersion Then" & CrLf
                Response.Write "    If confirm(""This page requires a newer version of VBScript to view. Do you want to upgrade now?"") Then" & CrLf
                Response.Write "        location.href = ""http://www.microsoft.com/msdownload/scripting.htm""" & CrLf
                Response.Write "    End If" & Crlf
                Response.Write "End If" & Crlf
    
                Response.Write "Dim FileList(), FileCount" & CrLf
                Response.Write "ReDim FileList(0)" & CrLf
    
                Response.Write "Sub AddFileTolist(strFilename)" & CrLf
                Response.Write "    Dim Length, strTemp" & CrLf
                Response.Write "    strTemp = Replace(strFilename, ""%"", ""%25"")" & CrLf
                Response.Write "    strTemp = Replace(strTemp, ""#"", ""%23"")" & CrLf
                Response.Write "    strTemp = Replace(strTemp, ""+"", ""%2B"")" & CrLf
                Response.Write "    strTemp = Replace(strTemp, "" "", ""+"")" & CrLf
                Response.Write "    strTemp = Replace(strTemp, ""&"", ""%26"")" & CrLf
                Response.Write "    strTemp = Replace(strTemp, "">"", ""%3E"")" & CrLf
                Response.Write "    strTemp = Replace(strTemp, ""<"", ""%3C"")" & CrLf
                Response.Write "    Length = UBound(FileList)" & CrLf
                Response.Write "    ReDim Preserve FileList(Length + 1)" & CrLf
                Response.Write "    FileList(Length) = strTemp" & CrLf
                Response.Write "    FileCount = Length + 1" & CrLf
                Response.Write "End Sub" & CrLf & CrLf
    
                Response.Write "Function GetFileListAsURL" & CrLf
                Response.Write "    Dim I, str, strSep" & CrLf
                Response.Write "    str = """" " & CrLf
                Response.Write "    strSep = """" " & CrLf
                Response.Write "    For I = 0 To UBound(FileList) - 1" & CrLf
                Response.Write "        str = str & ""CMFilename="" & FileList(I)" & CrLf
                Response.Write "        If I <> (UBound(FileList) - 1) Then str = str & ""&"" " & CrLf
                Response.Write "    Next" & Crlf
                Response.Write "    GetFileListAsURL = str" & CrLf
                Response.Write "End Function" & CrLf & CrLf
            End If
            g_fCommonCodeGenerated = True
        End If
    End Sub
                        
  3. Save the file.


WORKAROUND

Rename files so that do not contain a # before uploading to CM Sample Site.

MORE INFORMATION

The Site Server sample sites need to be modified and tested to make sure that the samples meet your needs.


Keywords: kbprb KB246884