My data extraction module reads data from the database (SQL) creates textfiles and ftp them to the internet via gprs modem. On the internet there is an asp program that reads the textfiles and after reading they are deleted.
My problem is how do i change the chmod from a VB program installed on a machine with Windows 2000. Is this possible to change before or during ftp the textfiles. If possible please help me!!!
I think you can change file permissions during an FTP session by using the command CHMOD.
when you have a connection established just send to the server the command "chmod 777 logfile.txt" where 777 is permission for read write and execute for every user group, followed by the name of the file you need to change the permissions...
if strFileFTP is the name of your file in the FTP server, be sure to be in the directory where the file is stored in the remote server maybe using CHDIR
why are you still using the "PUT" command in front of the string? put command is used to transfer a file to the ftp server, CHMOD is another command and it's used to change the permissions to a file and it has to be used alone. try using the string I suggested you!
before you send the command string put it into a variable to see how the string looks like
Dim s As String
s="CHMOD 777 " & strFileFTP
msgbox s 'see how's the command string you are sending
.Execute ,s
before using the CHMOD command be sure to be in the exact path where the file is stored, by moving inside the FTP server folders with "CHDIR <folder>" command.
an FTP server is like typing commands at the DOS prompt