Microsoft KB Archive/246884: Difference between revisions

From BetaArchive Wiki
m (Text replacement - "&" to "&")
m (Text replacement - """ to """)
 
Line 52: Line 52:


The code that is needed to translate the number sign (#) to its hexadecimal ASCII equivalent, 23, is missing.
The code that is needed to translate the number sign (#) to its hexadecimal ASCII equivalent, 23, is missing.
<pre class="codesample">Response.Write &quot;   strTemp = Replace(strTemp, &quot;&quot;#&quot;&quot;, &quot;&quot;%23&quot;&quot;)&quot; & CrLf
<pre class="codesample">Response.Write "   strTemp = Replace(strTemp, ""#"", ""%23"")" & CrLf
                 </pre>
                 </pre>


Line 68: Line 68:
         If g_fUseActiveX Then
         If g_fUseActiveX Then
          
          
             Response.Write &quot;Dim Version, RequiredVersion&quot; & CrLf
             Response.Write "Dim Version, RequiredVersion" & CrLf
             Response.Write &quot;RequiredVersion = 2&quot; & CrLf
             Response.Write "RequiredVersion = 2" & CrLf
             Response.Write &quot;If ScriptEngineMajorVersion = 0 Then&quot; & CrLf
             Response.Write "If ScriptEngineMajorVersion = 0 Then" & CrLf
             Response.Write &quot;   Version = 1&quot; & CrLf
             Response.Write "   Version = 1" & CrLf
             Response.Write &quot;Else&quot; & CrLf
             Response.Write "Else" & CrLf
             Response.Write &quot;   Version = ScriptEngineMajorVersion&quot; & CrLf
             Response.Write "   Version = ScriptEngineMajorVersion" & CrLf
             Response.Write &quot;End If&quot; & CrLf
             Response.Write "End If" & CrLf


             Response.Write &quot;If Version < RequiredVersion Then&quot; & CrLf
             Response.Write "If Version < RequiredVersion Then" & 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; & 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 &quot;       location.href = &quot;&quot;http://www.microsoft.com/msdownload/scripting.htm&quot;&quot;&quot; & CrLf
             Response.Write "       location.href = ""http://www.microsoft.com/msdownload/scripting.htm""" & CrLf
             Response.Write &quot;   End If&quot; & Crlf
             Response.Write "   End If" & Crlf
             Response.Write &quot;End If&quot; & Crlf
             Response.Write "End If" & Crlf


             Response.Write &quot;Dim FileList(), FileCount&quot; & CrLf
             Response.Write "Dim FileList(), FileCount" & CrLf
             Response.Write &quot;ReDim FileList(0)&quot; & CrLf
             Response.Write "ReDim FileList(0)" & CrLf


             Response.Write &quot;Sub AddFileTolist(strFilename)&quot; & CrLf
             Response.Write "Sub AddFileTolist(strFilename)" & CrLf
             Response.Write &quot;   Dim Length, strTemp&quot; & CrLf
             Response.Write "   Dim Length, strTemp" & CrLf
             Response.Write &quot;   strTemp = Replace(strFilename, &quot;&quot;%&quot;&quot;, &quot;&quot;%25&quot;&quot;)&quot; & CrLf
             Response.Write "   strTemp = Replace(strFilename, ""%"", ""%25"")" & CrLf
             Response.Write &quot;   strTemp = Replace(strTemp, &quot;&quot;#&quot;&quot;, &quot;&quot;%23&quot;&quot;)&quot; & CrLf
             Response.Write "   strTemp = Replace(strTemp, ""#"", ""%23"")" & CrLf
             Response.Write &quot;   strTemp = Replace(strTemp, &quot;&quot;+&quot;&quot;, &quot;&quot;%2B&quot;&quot;)&quot; & CrLf
             Response.Write "   strTemp = Replace(strTemp, ""+"", ""%2B"")" & CrLf
             Response.Write &quot;   strTemp = Replace(strTemp, &quot;&quot; &quot;&quot;, &quot;&quot;+&quot;&quot;)&quot; & CrLf
             Response.Write "   strTemp = Replace(strTemp, "" "", ""+"")" & CrLf
             Response.Write &quot;   strTemp = Replace(strTemp, &quot;&quot;&&quot;&quot;, &quot;&quot;%26&quot;&quot;)&quot; & CrLf
             Response.Write "   strTemp = Replace(strTemp, ""&"", ""%26"")" & CrLf
             Response.Write &quot;   strTemp = Replace(strTemp, &quot;&quot;>&quot;&quot;, &quot;&quot;%3E&quot;&quot;)&quot; & CrLf
             Response.Write "   strTemp = Replace(strTemp, "">"", ""%3E"")" & CrLf
             Response.Write &quot;   strTemp = Replace(strTemp, &quot;&quot;<&quot;&quot;, &quot;&quot;%3C&quot;&quot;)&quot; & CrLf
             Response.Write "   strTemp = Replace(strTemp, ""<"", ""%3C"")" & CrLf
             Response.Write &quot;   Length = UBound(FileList)&quot; & CrLf
             Response.Write "   Length = UBound(FileList)" & CrLf
             Response.Write &quot;   ReDim Preserve FileList(Length + 1)&quot; & CrLf
             Response.Write "   ReDim Preserve FileList(Length + 1)" & CrLf
             Response.Write &quot;   FileList(Length) = strTemp&quot; & CrLf
             Response.Write "   FileList(Length) = strTemp" & CrLf
             Response.Write &quot;   FileCount = Length + 1&quot; & CrLf
             Response.Write "   FileCount = Length + 1" & CrLf
             Response.Write &quot;End Sub&quot; & CrLf & CrLf
             Response.Write "End Sub" & CrLf & CrLf


             Response.Write &quot;Function GetFileListAsURL&quot; & CrLf
             Response.Write "Function GetFileListAsURL" & CrLf
             Response.Write &quot;   Dim I, str, strSep&quot; & CrLf
             Response.Write "   Dim I, str, strSep" & CrLf
             Response.Write &quot;   str = &quot;&quot;&quot;&quot; &quot; & CrLf
             Response.Write "   str = """" " & CrLf
             Response.Write &quot;   strSep = &quot;&quot;&quot;&quot; &quot; & CrLf
             Response.Write "   strSep = """" " & CrLf
             Response.Write &quot;   For I = 0 To UBound(FileList) - 1&quot; & CrLf
             Response.Write "   For I = 0 To UBound(FileList) - 1" & CrLf
             Response.Write &quot;       str = str & &quot;&quot;CMFilename=&quot;&quot; & FileList(I)&quot; & CrLf
             Response.Write "       str = str & ""CMFilename="" & FileList(I)" & CrLf
             Response.Write &quot;       If I <> (UBound(FileList) - 1) Then str = str & &quot;&quot;&&quot;&quot; &quot; & CrLf
             Response.Write "       If I <> (UBound(FileList) - 1) Then str = str & ""&"" " & CrLf
             Response.Write &quot;   Next&quot; & Crlf
             Response.Write "   Next" & Crlf
             Response.Write &quot;   GetFileListAsURL = str&quot; & CrLf
             Response.Write "   GetFileListAsURL = str" & CrLf
             Response.Write &quot;End Function&quot; & CrLf & CrLf
             Response.Write "End Function" & CrLf & CrLf
         End If
         End If
         g_fCommonCodeGenerated = True
         g_fCommonCodeGenerated = True

Latest revision as of 13:50, 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