Is it possible to get a program example of uploading/downloading files using sqlitening ??
This example works with a remote server. The same code will work in
local mode without the slConnect.
' Connect to remote server
' Open the local file for binary. It must already exist or an empty
' file will be created.
open "LocalFileUploadExample.Txt" for binary as #1
' Get all the data from local file into variable lsA and close it
get$ #1, lof(#1), lsA
' Upload the data using C ModChar so file will be created if not already there.
' If file is already there then will overwrite. For security reasons, all files
' must be included in the FACT of the server config file. This is because of the
' damage that can be done due to a coding error with PutFile.
slPutFile "RemoteFileUploadDownloadExample.Txt", lsA, "C"
' Download the data from the server into variable lsA
slGetFile "RemoteFileUploadDownloadExample.Txt", lsA
' Open the local file for binary. An empty file will be created
' if it doesn't exist or it will overwrite.
open "LocalFileDownloadExample.Txt" for binary as #1
' Put the date into local file from variable lsA and close
put$ #1, lsA
' Now LocalFileDownloadExample.Txt will be same as LocalFileUploadExample.Txt
Thanks for the help. You saved me hours of head scratching.
'UpDown.bas Works great!!
#COMPILE EXE "..\Bin\UpDown.exe"
FUNCTION PBMAIN AS LONG
LOCAL sServer, sFileName,sWrite,sRead, sResults AS STRING
LOCAL PortNumber, counter, result AS LONG
sServer = "192.168.1.3"
PortNumber = 51234
result = slConnect(sServer, PortNumber)
IF result THEN ? "Connect error"+ STR$(Result),%MB_ICONERROR,EXE.FULL$:EXIT FUNCTION
FOR counter = 1 TO 10
sFileName = "TEST1A.DAT" 'TEST1A.DAT in [FACT section]
IF counter = 4 THEN sFileName = "" 'create an error
sWrite = SPACE$(counter * 100000)
result = slPutFile(sFileName, sWrite,"C")
IF result THEN sResults = sResults + "Put error" + STR$(result)+ $CR
result = slGetFile(sFileName, sRead)
IF result THEN sResults = sResults + "Get error" + STR$(result) + $CR
sResults = sResults + FORMAT$(LEN(sRead),"#,") + " bytes" + $CR