With the following code, I am getting the following error message:
quote:
-2147352567 Binary err
Here is the code..
code:
BREAK ON
Dim $oStream
; -- http://support.microsoft.com/default.aspx?scid=kb;EN-US;q298108
; -- http://support.microsoft.com/default.aspx?scid=kb;EN-US;q296713
; -- http://support.microsoft.com/support/kb/articles/Q237/9/06.ASP
; -- http://www.bibit.com/asp_example_source_documentation.html
$address = "site.com"
$rdir = "/kdyer/kdyer"
$user = "kdyer"
$password = "pass"
$file = "C:\cr.dbf"
$ftpobj = CreateObject("microsoft.xmlhttp")
$oStream = CreateObject("ADODB.Stream")
; -- Convert to binary
$oStream.Type = 1 ; adTypeBinary
;;$oStream.Type = 2 ; adTypeText
;$bFileData = $oStream.LoadFromFile($file)
$oStream.LoadFromFile($file)
$oStream.open
IF @error <> 0
?@error " Binary err"
get $
EXIT 1
ENDIF
;;$ftpobj.open("POST", $address, FALSE, $user, $password)
; -- http://www.planet-source-code.com/xq/ASP/txtCodeId.5746/lngWId.1/qx/vb/scripts/ShowCode.htm
$ftpobj.open("GET",$address,not 1)
$ftpobj.send
$strCookie = $ftpobj.getResponseHeader("set-cookie")
$strCookie = Left($strCookie, InStr($strCookie, ";") - 1)
;better check the feedback
$testresl = $ftpobj.responseText
?$testresl
;do the actual send
$ftpobj.open("POST", $address+$rdir, not 1, $user, $password)
$ftpobj.setRequestHeader("Cookie", $strCookie)
;we need to do it a second time due to K
; B article Q234486.
$ftpobj.setRequestHeader("Cookie", $strCookie)
$ftpobj.setrequestheader("MIME-Version", "1.0")
$ftpobj.setRequestHeader("Depth", "0")
; -- Think we need to do something like
; -- http://support.microsoft.com/default.aspx?scid=kb;en-us;Q298108
; -- Re. Lvarbin
;$ftpobj.send($file) ; -- If we comment out this line we can see the site
$ftpobj.send($bFileData)
$testres = $ftpobj.responseText ; -- this actually draws the FTP Site :)
?$testres
?"Press a key"
get $
Thinking some coversion may need to be done..
code:
;ref - http://cwashington.netreach.net/depo/view.asp?Index=622&ScriptType=vbscript
Function decimalToBinary($intDecimal)
$strBinary = ""
$intDecimal = cInt($intDecimal)
While ($intDecimal > 1)
$lngNumber1 = $intDecimal / 2
$lngNumber2 = Fix($lngNumber1)
If ($lngNumber1 > $lngNumber2)
$strDigit = "1"
Else
$strDigit = "0"
EndIf
$strBinary = $strDigit + $strBinary
$intDecimal = Fix($intDecimal / 2)
Loop
$strBinary = "1" & $strBinary
While Len($strBinary) < 8
$strBinary = "0" + $strBinary
Loop
$binString = $strBinary
EndFunction
Any insights?
Kent