WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

WinInet
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

iFtpPut to Unix Server

Keywords:  iFtpPut

Question:

I am trying to FTP a file to a "sub-directory" on a Unix server. However, the file goes to the root directory (with the sub-directory name NOW included with the filename. It just PUTs the file in the WRONG place. Any assistance very much appreciated.

Example:

I want to put the TRANS301.zip file into the /morning sub-directory.

After the iFtpPut the file is stored in the root directory as: \morning\TRANS301.zip

Below is the snippet of code I am using:

filenam=fileroot(locfilename)
ext=fileextension(locfilename)

targfilename=strcat("\morning\",filenam,".",ext)
fsize=itemextract(3,locfilename,@Tab)
ret=iFtpPut(conhandle,locfilename,targfilename,fsize,@BINARY) 

Answer:

The slashes go the other way in Unix. Try...
targfilename=strcat("/morning/",filenam,".",ext)
fsize=itemextract(3,locfilename,@Tab)
ret=iFtpPut(conhandle,locfilename,targfilename,fsize,@BINARY)

Article ID:   W14205
Filename:   iFtpPut to Unix Server.txt
File Created: 2017:07:28:13:58:47
Last Updated: 1999:10:26:11:23:36