Steve-vfp9user
Programmer
Hello
A previous thread I started worked perfectly for uploading and downloading files from a server.
This was ok if you knew the file name.
The coding I used was this:
The send.txt looks like this:
So this works ok if you know the file name however, tables I am now trying to upload will be a variable name for example:
* An example of what mjobupload looks like could be 4-2016-SW
From here I want to upload the DBF and FPT that has been created from the record appended from MYTABLE: mjobupload+'.dbf' and mjobupload+'.fpt'
I have tried changing the send.txt file to the below which does not upload the relevant files:
The reason for the unique file name is that this will be downloaded by someone else and requires a unique name.
In view of the above, can anyone shed some light on what I am missing?
Thank you
Steve
A previous thread I started worked perfectly for uploading and downloading files from a server.
This was ok if you knew the file name.
The coding I used was this:
Code:
*sendftp.prg
RUN ftp -i -s:send.txt
The send.txt looks like this:
Code:
open ftp.mywebsite.co.uk
myusername-xxxxxx
mypassword
binary
send test.txt
close
bye
exit
So this works ok if you know the file name however, tables I am now trying to upload will be a variable name for example:
Code:
USE MYTABLE SHARED
mupjobnumb=JOBNUMB
mupjobyear=JOBYEAR
STORE WORKINT TO mupworkint
mjobupload=LTRIM(STR(mupjobnumb))+"-"+LTRIM(STR(mupjobyear))+"-"+ALLTRIM(mupworkint)
* An example of what mjobupload looks like could be 4-2016-SW
Code:
USE MYTABLE SHARED
COPY STRUCTURE TO mjobupload+'.dbf'
CLOSE DATABASES
USE mjobupload+'.dbf' EXCLUSIVE
APPEND FROM MYTABLE FOR RECNO()=mrecno
From here I want to upload the DBF and FPT that has been created from the record appended from MYTABLE: mjobupload+'.dbf' and mjobupload+'.fpt'
I have tried changing the send.txt file to the below which does not upload the relevant files:
Code:
open ftp.mywebsite.co.uk
myusername-xxxxxx
mypassword
binary
send mjobupload+'.dbf'
send mjobupload+'.fpt'
close
bye
exit
The reason for the unique file name is that this will be downloaded by someone else and requires a unique name.
In view of the above, can anyone shed some light on what I am missing?
Thank you
Steve