Link to home
Start Free TrialLog in
Avatar of zwarte
zwarteFlag for Belgium

asked on

TNMFTP white lines in textfile

Hi guys (girls),
I'm working with the TNMFTP component with which I download TXT and JPG files.
This works.

Problem :
If I load a TXT file and read it right after I downloaded it
x : 'filename.txt';
ftp : tnmftp;
list : tstringlist;

ftp.connect;
ftp.downloadĀ (x,x);
list.loadfromfile(x);
ftp.disconnect;

the text file contains
1 line of text,
1 white line
1 line of text
1 white line
etc...

however, if I load the textfile in notepad afterwards, it seems to be fine, and i can use it in any program without any problem.

Basically the same happens for JPG, only this results in a picture that is totally f*cked, pardon my frech :-)

Why is this happening, and how can I prevent it from happening ?

Tom,
ASKER CERTIFIED SOLUTION
Avatar of jeurk
jeurk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TheNeil
TheNeil

Just a wild stab in the dark but have you tried using the mode method of the NMFTP component to be something other than MODE_ASCII?

The Neil
Neil is 99% correct (%1 chance of error, recount needed) all you do is this....

nmftp1.Mode(MODE_IMAGE);

Put that JUST before u download / upload.....


Craig C.
oops Jeurk was correct too!!!!!, before Neil :)
;)
Avatar of zwarte

ASKER

hi guys,

tnx for all the info,
jeurk's answer lead me to a correct solution,
apparently there are 3 modes to choose from in TNMFTP
MODE_ASCII
MODE_BYTE
MODE_IMAGE

first i tried BYTE, which apparently was not supported by the server (unrecognised type error), then I tried the MODE_IMAGE which worked fine for my text files, as well as for my images,so, i'm accepting jeurk's comment as an answer.

Once more tnx for the help,

Tom,
fine.... but i actually said what image to use......!!!!!!!!!!!!
Avatar of zwarte

ASKER

to craig capel,

admitted,
but jeurk was first and tackled the problem, you just specified and elaborated a bit.

Better luck next time ;-)
oh no, i was not complaining about that, i was the first to point out he got there!...

what i was onabout, i gave him the image to use....... he tried all but the one i pointed out.....
zwarte.... could you have a look at this for me please?......

http://www1.experts-exchange.com/questions/10330776/IPs.html

Now this is what i have to put up with.....