Microsoft KB Archive/246884

From BetaArchive Wiki
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