#89888 - 2002-11-30 09:40 PM
Re: FTP via InetCtls.Inet.1
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
|
Top
|
|
|
|
#89889 - 2002-12-01 07:32 AM
Re: FTP via InetCtls.Inet.1
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I would like to see authentication methods implemented..
That is a UserID and password..
Not only a FTPGet but FTPPut too.
Kent [ 01. December 2002, 07:33: Message edited by: kdyer ]
|
Top
|
|
|
|
#89891 - 2002-12-02 08:01 AM
Re: FTP via InetCtls.Inet.1
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Jooel,
It seems that I am really close with this..
I have tried encoding with image/jpeg too.
code:
BREAK ON ; -- http://support.microsoft.com/default.aspx?scid=kb;EN-US;q298108 ; -- http://support.microsoft.com/default.aspx?scid=kb;EN-US;q296713 $user = "kdyer" $password = "password" $address = "ftp://ftpsite" $rdir = "/kdyer" $file = "C:\untitled1.jpg" $ftpobj = CreateObject("microsoft.xmlhttp") IF @error <> 0 ?@error SLEEP 2 EXIT 1 ENDIF
$ftpobj.open("PUT", $address, FALSE, $user,$password)
IF $file <> "" ; -- check to insure that you have the right encoding ;application/x-www-form-urlencoded ;image/gif ;image/x-xbitmap ;image/jpeg ;image/pjpeg; ;application/vnd.ms-powerpoint; ;application/vnd.ms-excel ;application/msword ;*/* $ftpobj.setrequestheader = "Content-Type", "*/*" $ftpobj.send $file ENDIF $ftpobj = 0
Thanks,
Kent
|
Top
|
|
|
|
#89894 - 2002-12-03 02:24 AM
Re: FTP via InetCtls.Inet.1
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Will look into this app this evening. Was busy trying to sort out a Citrix Printing issue today.
Kent
|
Top
|
|
|
|
#89899 - 2002-12-03 02:53 AM
Re: FTP via InetCtls.Inet.1
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Les,
We have the new client.. It is not that we cannot print, but the Admin that put the Application on the server, you cannot print Management Reports from it.
Kent
|
Top
|
|
|
|
#89901 - 2002-12-03 09:27 AM
Re: FTP via InetCtls.Inet.1
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
{Edit - Corrected the GET/POST} Well..
I can get it to draw a pretty html doc, but not post.
code:
BREAK ON ;;Dim $binaryContent ; -- 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 $user = "uid" $password = "pass" $address = "ftp://site.com/kdyer" $rdir = "/kdyer" $file = "C:\untitled1.jpg" $ftpobj = CreateObject("microsoft.xmlhttp") IF @error <> 0 ?@error SLEEP 2 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 $file $testres = $ftpobj.responseText ; -- this actually draws the FTP Site :) ?$testres ?"Press a key" get $
I am pretty trashed.. Time for rest..
Added in a note about Lvarbin: where I think we need to convert to binary data before posting.
Hmmm..
Kent [ 03. December 2002, 09:39: Message edited by: kdyer ]
|
Top
|
|
|
|
#89903 - 2002-12-03 09:40 AM
Re: FTP via InetCtls.Inet.1
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
|
Top
|
|
|
|
#89904 - 2002-12-04 04:50 PM
Re: FTP via InetCtls.Inet.1
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
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
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
1 registered
(Allen)
and 566 anonymous users online.
|
|
|