Solved

TNMFTP  white lines in textfile

Posted on 2000-04-19
10
310 Views
Last Modified: 2012-05-04
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,
0
Comment
Question by:zwarte
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 4

Accepted Solution

by:
jeurk earned 50 total points
ID: 2729978
Hello,
I think this may be a unix to win problem
conversion.
Try to use the function AdjustLineBreaks(const S: string): string;
on each of the lines you get.

Or maybe it's a problem of ftp mode ?
are you working in binary or in ascii ?
if you are using one, try the other.

CU
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2729996
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
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2730135
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:craig_capel
ID: 2730138
oops Jeurk was correct too!!!!!, before Neil :)
0
 
LVL 4

Expert Comment

by:jeurk
ID: 2730255
;)
0
 
LVL 1

Author Comment

by:zwarte
ID: 2733793
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,
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2733910
fine.... but i actually said what image to use......!!!!!!!!!!!!
0
 
LVL 1

Author Comment

by:zwarte
ID: 2733925
to craig capel,

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

Better luck next time ;-)
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2733987
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.....
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2735743
zwarte.... could you have a look at this for me please?......

http://www1.experts-exchange.com/Computers/Programming/Windows/Delphi/Q_10330776.html

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Working this component WebCopy with proxy, help 3 100
Delphi 2 77
SUM 2 INTEGER ARRAYS INTO 1 10 111
Delphi android app hide keyboard 3 40
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question