Topic "Empty file downloaded"

Author Message
[View user's profile]

Joined: 2015-10-13
Posts: 2
Hi there, I'm having an issue with downloading text files from an ftp server. Multiple times a day I upload files to a certain folder called outbound. From this folder a different user runs a script (see below) that downloads all these files with 30 min. intervals. After it has downloaded all files, it moves the files to a folder outbound/archive on the ftp. The script runs on Windows 2008 Server with WinSCP version 5.7.2 build 5316.

Command line:
"PathToWinSCP\winscp.exe" /script=PathToScript\Script.txt /xmllog=PathToLog\LogFTP.xml

option batch abort
option confirm off
open ftp://<ftpurl>
cd /outbound
option transfer binary
get foo*.txt e:\downloads\
mv foo*.txt /outbound/archive/

This all seemed to work great, except for the last two weeks in which we encountered twice the issue that a file was downloaded as a 0 bytes file. However, looking back at these files in the outbound/archive folder they did contain data.

So now the question remains how this is possible. At first I thought that maybe the script tried to download the file while it was still being written. However, another file that was uploaded after the 'empty' file, was downloaded correctly. So that scenario does not seem very likely.

I've attached the only logs that I could retrieve, not sure whether there should be more extensive ones.

Does anybody else have an idea for a possible reason? Should I try a more extensive script to only download the file when it is not empty and also only move the file in that case?

I hope you can help!
Winscp log.txt (1.02 KB) [Download]

Description: (none)

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
We need a session log file (/log) to investigate.
[View user's profile]

Joined: 2015-10-13
Posts: 2
prikryl wrote:
We need a session log file (/log) to investigate.

Thanks for your reply. I don't think the other user had turned this logging on, or is that not possible? Anyway I'll try to recreate the issue myself.

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License