Operating System - HP-UX
1752315 Members
5499 Online
108786 Solutions
New Discussion

550 : Cannot creat file error on ftp

 
Donald Whitaker
Occasional Contributor

550 : Cannot creat file error on ftp

I am trying to ftp a file to a remote system. This process works fine when I execute the script that does the ftp, directly from my session, but I would like a script to call the script that does the ftp. When I run script to call the script. The ftp command connects to the remote and can execute commands but when it tries to put a file, I get the message "Cannot create file".

Here are my scripts:
#!/bin/sh
#
set -x
ftp -v 63.134.XXX.XXX <cd test
put $1
dir
quit
EOT

I use a .netrc file for connecting and the above works fine from a session. If I use this script to run it:

. /home/rehrig/v63yor/ftpcmd.sh /users/banker/myfile.txt

I get a cannot create file error.
Here is my output:
PROD:/users/banker>ftptest
+ ftp -v 63.134.xxx.xxx
+ 0<<
cd test
put /users/banker/edi810.txt
dir
quit
Connected to 63.134.xxx.xxx.
220 Serv-U FTP Server v6.2 for WinSock ready...
331 User name okay, need password.
230 User logged in, proceed.
Remote system type is UNIX.
Using binary mode to transfer files.
250 Directory changed to /test
200 PORT Command successful.
550 edi810.txt: Cannot create file.
200 PORT Command successful.
150 Opening ASCII mode data connection for /bin/ls.
drw-rw-rw- 1 user group 0 Mar 26 12:02 .
drw-rw-rw- 1 user group 0 Mar 26 12:02 ..
226 Transfer complete.
221 Goodbye!


If I use an ftp client tool I can read
and write from the remote computer just fine,
so I don't think its an issue with the remote.
Any help will be much appreciated with points.
Thanks
1 REPLY 1
Steven Schweda
Honored Contributor

Re: 550 : Cannot creat file error on ftp

> Here are my scripts:

I see only one script (and the name of
another one).

> put $1

And what was "$1" when it worked?

> put /users/banker/edi810.txt

That doesn't look to me like a very good file
name to use on a Windows system.