Microsoft VBScript compilation error '800a040

Results 1 to 2 of 2

Thread: Microsoft VBScript compilation error '800a040

  1. #1
    Join Date
    Dec 1969

    Default Microsoft VBScript compilation error '800a040

    Hi every body,<BR><BR>I am using the code which is written for uploading the file i.e upload.asp<BR><BR>the code which is used for uploading <BR>----------------------------------<BR>&#060;%<BR>&#039;***************************** **********<BR>&#039; File: Upload.asp<BR>&#039; Author: Jacob "Beezle" Gilley<BR>&#039; Email:<BR>&#039; Date: 12/07/2000<BR>&#039; Comments: The code for the Upload, CByteString, <BR>&#039; CWideString subroutines was originally <BR>&#039; written by Philippe Collignon...or so <BR>&#039; he claims. Also, I am not responsible<BR>&#039; for any ill effects this script may<BR>&#039; cause and provide this script "AS IS".<BR>&#039; Enjoy!<BR>&#039;********************************** ******<BR><BR>Class FileUploader<BR> Public Files<BR> Private mcolFormElem<BR><BR> Private Sub Class_Initialize()<BR> Set Files = Server.CreateObject("Scripting.Dictionary")<BR> Set mcolFormElem = Server.CreateObject("Scripting.Dictionary")<BR> End Sub<BR> <BR> Private Sub Class_Terminate()<BR> If IsObject(Files) Then<BR> Files.RemoveAll()<BR> Set Files = Nothing<BR> End If<BR> If IsObject(mcolFormElem) Then<BR> mcolFormElem.RemoveAll()<BR> Set mcolFormElem = Nothing<BR> End If<BR> End Sub<BR><BR> Public Property Get Form(sIndex)<BR> Form = ""<BR> If mcolFormElem.Exists(LCase(sIndex)) Then Form = mcolFormElem.Item(LCase(sIndex))<BR> End Property<BR><BR> Public Default Sub Upload()<BR> Dim biData, sInputName<BR> Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos<BR> Dim nPosFile, nPosBound<BR><BR> biData = Request.BinaryRead(Request.TotalBytes)<BR> nPosBegin = 1<BR> nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))<BR> <BR> If (nPosEnd-nPosBegin) &#060;= 0 Then Exit Sub<BR> <BR> vDataBounds = MidB(biData, nPosBegin, nPosEnd-nPosBegin)<BR> nDataBoundPos = InstrB(1, biData, vDataBounds)<BR> <BR> Do Until nDataBoundPos = InstrB(biData, vDataBounds & CByteString("--"))<BR> <BR> nPos = InstrB(nDataBoundPos, biData, CByteString("Content-Disposition"))<BR> nPos = InstrB(nPos, biData, CByteString("name="))<BR> nPosBegin = nPos + 6<BR> nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))<BR> sInputName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))<BR> nPosFile = InstrB(nDataBoundPos, biData, CByteString("filename="))<BR> nPosBound = InstrB(nPosEnd, biData, vDataBounds)<BR> <BR> If nPosFile &#060;&#062; 0 And nPosFile &#060; nPosBound Then<BR> Dim oUploadFile, sFileName<BR> Set oUploadFile = New UploadedFile<BR> <BR> nPosBegin = nPosFile + 10<BR> nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))<BR> sFileName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))<BR> oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\"))<BR><BR> nPos = InstrB(nPosEnd, biData, CByteString("Content-Type:"))<BR> nPosBegin = nPos + 14<BR> nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))<BR> <BR> oUploadFile.ContentType = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))<BR> <BR> nPosBegin = nPosEnd+4<BR> nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2<BR> oUploadFile.FileData = MidB(biData, nPosBegin, nPosEnd-nPosBegin)<BR> <BR> If oUploadFile.FileSize &#062; 0 Then Files.Add LCase(sInputName), oUploadFile<BR> Else<BR> nPos = InstrB(nPos, biData, CByteString(Chr(13)))<BR> nPosBegin = nPos + 4<BR> nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2<BR> If Not mcolFormElem.Exists(LCase(sInputName)) Then mcolFormElem.Add LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))<BR> End If<BR><BR> nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData, vDataBounds)<BR> Loop<BR> End Sub<BR><BR> &#039;String to byte string conversion<BR> Private Function CByteString(sString)<BR> Dim nIndex<BR> For nIndex = 1 to Len(sString)<BR> CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1)))<BR> Next<BR> End Function<BR><BR> &#039;Byte string to string conversion<BR> Private Function CWideString(bsString)<BR> Dim nIndex<BR> CWideString =""<BR> For nIndex = 1 to LenB(bsString)<BR> CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1))) <BR> Next<BR> End Function<BR>End Class<BR><BR>Class UploadedFile<BR> Public ContentType<BR> Public FileName<BR> Public FileData<BR> <BR> Public Property Get FileSize()<BR> FileSize = LenB(FileData)<BR> End Property<BR><BR> Public Sub SaveToDisk(sPath)<BR> Dim oFS, oFile<BR> Dim nIndex<BR> <BR> If sPath = "" Or FileName = "" Then Exit Sub<BR> If Mid(sPath, Len(sPath)) &#060;&#062; "\" Then sPath = sPath & "\"<BR> <BR> Set oFS = Server.CreateObject("Scripting.FileSystemObject")< BR> If Not oFS.FolderExists(sPath) Then Exit Sub<BR> Set oFile = oFS.CreateTextFile(sPath & FileName, True)<BR> <BR> For nIndex = 1 to LenB(FileData)<BR> oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))<BR> Next<BR><BR> oFile.Close<BR> End Sub<BR> <BR> Public Sub SaveToDatabase(ByRef oField)<BR> If LenB(FileData) = 0 Then Exit Sub<BR> <BR> If IsObject(oField) Then<BR> oField.AppendChunk FileData<BR> End If<BR> End Sub<BR><BR>End Class<BR>%&#062;<BR><BR>---------------------------------<BR><BR><BR>this file is including in my candidate.asp file.<BR><BR>but it&#039;s giving me problem when i am using <BR><BR>the error is <BR><BR>Microsoft VBScript compilation error &#039;800a0401&#039; <BR><BR>Expected end of statement <BR><BR>/candidate/upload.asp, line 36 <BR><BR>Public Property Get Form(sIndex)<BR>----------------^<BR><BR><BR>please help me...<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Microsoft VBScript compilation error '800

    Don&#039;t put spaces in function names i.e.<BR>Public Sub Get_Form(sIndex)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts