Mike,
Where in code you create file (lcFilename). In the code you just declare filename . I thinking you forget next STRTOFILE() and wrong addpostkey:
lcFileText = oHttp.EncodeDbf("c:\temp4\acctemp.dbf',.t.)
LCFILENAME = ADDBS(LCTEMPPATH)+SYS(3)+".txt"
nBytes = STRTOFILE(lcFileText,lcFilename)
Because lcFileText - its binary string as result encoding of DBF. Then you must write
OHTTP.ADDPOSTKEY("acctemp",LCFILENAME,.T.)
here "acctemp" is key name.. no binary data
Denis
>Denis:
>I have attempted to model my code after yours as below.
>
>The code falls apart on the line
>OHTTP.ADDPOSTKEY(lcfiletext,LCFILENAME,.T.)
>and the error message is "File Not Found".
>
>Could you advise what i am doing wrong here.
>
>Mike Smith
>************************
>OHTTP = CREATEOBJECT("wwIPStuff")
>LCFILETEXT = Ohttp.ENCODEDBF('c:\temp4\acctemp.dbf',.T.)
>SET PROCEDURE TO WWHTTP ADDIT
>LCTEMPPATH = SYS(2023)
>LCFILENAME = ADDBS(LCTEMPPATH)+SYS(3)+".txt"
>LCUPLOADURL = "
HTTP://www.doncasteroffice.net/rentmast/wc.dll?rentproc~Upload"
>LCADMINPASS = "SomeSecretWord"
>*** Set mode to multi-part form
>OHTTP.NHTTPPOSTMODE = 2
>*** Post a file and a regular form variable
>OHTTP.ADDPOSTKEY(lcfiletext,LCFILENAME,.T.)
>*** Post Admin Pass as variable
>OHTTP.ADDPOSTKEY("AdminPass",LCADMINPASS,.F.)
>WAIT "Please wait... request processing..." WINDOW NOWAIT
>LCHTML = OHTTP.HTTPGET(LCUPLOADURL)
>OHTTP.HTTPCLOSE()
>RETURN