PDA

View Full Version : files not uploading properly through FTP


gibby
06-23-2005, 12:20 PM
Hi,

I have an FTP service running through IIS 6.0 on my Windows Server 2003 Web Edition server in my office network. I finally got the FTP service to connect to remote computers, and file uploading and downloading seems to work. There's just one problem: once any file is uploaded, it's contents are empty. It's size reads 0 KB and when I open it (on the server) there's nothing there. TXT files show no text, JPG files show "no preview", HTML files display nothing, etc.

Incidentally, I discovered that some of the more complex files sometimes upload partially, like a Word or Excel file, and report an error in the middle of the transfer. Here's a snippet from the log file when I tried to transfer a Word document:

[3,6/23/2005 9:44:38 AM,0]REST 1024
[3,6/23/2005 9:44:38 AM,0]350 Restarting at 1024.
[3,6/23/2005 9:44:38 AM,1]This server supports restarts OK.
[3,6/23/2005 9:44:38 AM,1] -- Resuming of interrupted transfers enabled.
[3,6/23/2005 9:44:38 AM,1] -- Multipart downloads enabled.
[3,6/23/2005 9:44:38 AM,1]Sending another "REST" command to set the restart marker back to 0.
[3,6/23/2005 9:44:38 AM,0]REST 0
[3,6/23/2005 9:44:38 AM,0]350 Restarting at 0.
[3,6/23/2005 9:44:38 AM,1]Finished checking for "REST" command support.
[3,6/23/2005 9:44:38 AM,0]TYPE I
[3,6/23/2005 9:44:38 AM,0]200 Type set to I.
[3,6/23/2005 9:44:38 AM,0]PORT 192,168,1,105,6,50
[3,6/23/2005 9:44:38 AM,0]200 PORT command successful.
[3,6/23/2005 9:44:38 AM,0]STOR Cryptext Manual.doc
[3,6/23/2005 9:44:38 AM,0]150 Opening BINARY mode data connection for Cryptext Manual.doc.
[3,6/23/2005 9:44:38 AM,0]426 Connection closed; transfer aborted.
[3,6/23/2005 9:44:38 AM,0]# transferred 76288 bytes in 0.160 seconds, 3719.644 Kbps ( 464.955 Kbps), transfer failed.
[3,6/23/2005 9:44:38 AM,0]TYPE I
[3,6/23/2005 9:44:38 AM,0]200 Type set to I.
[3,6/23/2005 9:44:38 AM,0]PORT 192,168,1,105,6,51
[3,6/23/2005 9:44:38 AM,0]200 PORT command successful.
[3,6/23/2005 9:44:38 AM,0]REST 76288
[3,6/23/2005 9:44:38 AM,0]350 Restarting at 76288.
[3,6/23/2005 9:44:38 AM,0]STOR Cryptext Manual.doc
[3,6/23/2005 9:44:38 AM,0]550 Cryptext Manual.doc: The data is invalid.
[-1,6/23/2005 9:44:38 AM,4]Transfer request completed with status: Failed, 1 SubItem(s) failed

Anybody know what the problem is?

afterburn
06-23-2005, 01:17 PM
Ok that is the log file of the client application what is the log file of the server?

it should show a reason why it was terminated.

But it sounds as if you do not have passive mode enabled and have the firewall enabled.

Enable passive mode or disable the firewall which I wouldn't do, but rather open port 20 and 21 on both client and server.

gibby
06-23-2005, 06:04 PM
Well, I tried shutting off all firewalls and setting my FTP client to passive mode, but it still doesn't work. Any other thoughts?

afterburn
06-23-2005, 08:37 PM
try the server logs, you turn the one off on the server?

Horus_Kol
06-24-2005, 05:26 AM
it's not a firewall issue - you wouldn't have gotten any response at all if it were being blocked.

Passive/Active - maybe...

It is just this one file, or any file?

afterburn
06-24-2005, 06:32 AM
thats not true. because commands and responses are issued over port 21, if FTP is open it might not be for 20 which is where the file streams from.

gibby
06-25-2005, 10:39 AM
This happens for almost any file. Here's the snippet from the log file on the server. I think I have the time setting wrong on the server, but from 14:44:30 to 14:44:39 are the closest matching entries to what's in the log file on the client side.

14:44:30 192.168.1.1 [40]USER IUSR_************* 331 0
14:44:30 192.168.1.1 [40]PASS - 230 0
14:44:30 192.168.1.1 [40]CWD / 250 0
14:44:39 192.168.1.1 [40]created /Cryptext+Manual.doc 426 64
14:44:39 192.168.1.1 [40]created Cryptext+Manual.doc 550 13

I'm not an expert in interpreting these things, but I'd say the server didn't encounter any problems. Nevertheless, the file uploaded incompletely, and the client log says the transfer failed because the file was invalid. I'm not sure what else I can tell you. Does this trigger any further insight for anyone?

afterburn
06-25-2005, 09:54 PM
that is not a log file from IIS.

you need to look at that again. Also why are you using IUSR_ user name and password?


426 Connection closed; transfer aborted. that is the first error code.
550 Requested action not taken.

is the second. I would have to say that you have a firewall blocking either the port on client or server. Or you have not allowed access to the internet for that program on your firewall even if you open those ports.

gibby
06-27-2005, 10:11 PM
OK, I figured out why FTP wasn't working properly. I had to reconfigure my router the right way.

Originally, I had port forwarding like this:

ports 80 to 80 forward to 192.168.1.100
ports 20 to 21 forward to 192.168.1.100

That caused problems for visiting my websites on the server, causing them to require authentication before letting anyone view them. So then I tried this:

ports 20 to 80 forward to 192.168.1.100

This seemed to get rid of the authentication problem, but caused the problem of not being able to upload files properly. That, and one of our in-office email addresses wasn't working properly. So finally, I tried this, and it works:

port 80 to 80 forward to 192.168.1.100
port 20 to 20 forward to 192.168.1.100
port 21 to 21 forward to 192.168.1.100

afterburn
06-27-2005, 10:23 PM
so you have a firewall router as i originally said it was a firewall issue but didn;t assume that you another device.