FTP - in one batch file?
Moderator: DosItHelp
Re: FTP - in one batch file?
The file I am downloading is a batch file which currently is 107KB. So I find ASCII to be better.
Binary tends to corrupt the file.
Reading N'a, JC. I prefer to watch tutorials (because I am a visual learner). such as thenewboston on youtube.
He does make great tutorials.
So any luck on that ps script? It should look familiar if it does look familiar. I haven't modified it.
If you can get it to download or have an option to download in ASCII that would be great.
Thanks
Binary tends to corrupt the file.
Reading N'a, JC. I prefer to watch tutorials (because I am a visual learner). such as thenewboston on youtube.
He does make great tutorials.
So any luck on that ps script? It should look familiar if it does look familiar. I haven't modified it.
If you can get it to download or have an option to download in ASCII that would be great.
Thanks
Re: FTP - in one batch file?
What i've wanted to say above:Adrianvdh wrote:So I find ASCII to be better.
Binary tends to corrupt the file.
You are wrong: Transfering in ASCII mode tends to corrupt data, as the byte value 128 then is transformed to 0, 129 to 1, 130 to 2, ... .
Transfering in binary mode does not change data intentionally.
I know:Adrianvdh wrote:So would you be interested in telling me how many languages you know.
commodore basic, batch, turbo pascal, logo, c, c++, assembler, html, xml, (xhtml,) javascript, java, latex, perl, matlab, haskell, lisp, c#, vbs, jscript, powerscript, svg, b r a i n f u c k, b r a i n f u c k 2 d, spl (shakespeare programming language), whenever, lolcode, whitespace, hq9, java2k, intercal, Fortran, cobol, delphi (objective pascal), objective c, modula, ... .
But all after b r a i n f u c k 2 d i haven't used, i only know them, and yes i've programmed exactly one b r a i n f u c k program... (i should have avoided that).
(The b r a i n f u c k, and b r a i n f u c k 2 d doesn't contain any whitespaces, but i have to do it because if don't add whitespaces you only can read **censored**; and YES the language has this (rude) name.)
penpen
Re: FTP - in one batch file?
If you uploaded the file in ASCII mode you should download a Batch file in ASCII mode as well. The reason why it's getting corrupted in BINARY mode is that the line breaks are adopted from the servers operating system (often Linux) otherwise.
If you want to learn another programming language I find it not helpful to learn Batch first. It follows a completely different concept and the syntax isn't comparable with any other language.
There is definitly no answer to the question "What programming language is the best?". It depends on the purpose of your programming and the syntax you like.
Nowadays managed object oriented languages like Java (platform independent) or C# (Windows only unless you use Mono) would be a good choice in my opinion.
My favorite is C (even if I also know a few other languages) but I do NOT recomment you to learn it because it would be counterproductive if you want to learn an object oriented language later and you are fully responsible for the memory management which is made for masochists.
Regards
aGerman
If you want to learn another programming language I find it not helpful to learn Batch first. It follows a completely different concept and the syntax isn't comparable with any other language.
There is definitly no answer to the question "What programming language is the best?". It depends on the purpose of your programming and the syntax you like.
Nowadays managed object oriented languages like Java (platform independent) or C# (Windows only unless you use Mono) would be a good choice in my opinion.
My favorite is C (even if I also know a few other languages) but I do NOT recomment you to learn it because it would be counterproductive if you want to learn an object oriented language later and you are fully responsible for the memory management which is made for masochists.
Regards
aGerman
Re: FTP - in one batch file?
In this case:
The file is not getting corrupted while downloading, it was corrupted when uploading in textmode.
In binary mode you download the corrupted data as it actually is.
The server may automatically reconstruct it, when downloading in ascii mode, but the error was caused by server sided reformating of the (text) data, and has only few to do with binary or ascii transfer mode, but many with the server behavior, that should (hopefully) be controllable by server settings.
If not force the server to use binary mode as i suggested above... although i haven't explained well, why all this happens... .
penpen
Edit:
But you two are right, it could also be fixed by using ascii transfer mode, but this assumes that the server IS reconstructing the ascii data when downloading in ascii mode (there is no guarantee that the server behaves in this way).
Btw: The function DownloadFile of System.Net.WebClient is using the default browser to download unknown files and known non-text files using binary mode and known text files using text mode.
Most servers in inet don't reconstruct the html files, that are downloaded in text mode.
So just try to save the file as a "txt" file on the server, and try out if it reconstructs the line breaks.
The file is not getting corrupted while downloading, it was corrupted when uploading in textmode.
In binary mode you download the corrupted data as it actually is.
The server may automatically reconstruct it, when downloading in ascii mode, but the error was caused by server sided reformating of the (text) data, and has only few to do with binary or ascii transfer mode, but many with the server behavior, that should (hopefully) be controllable by server settings.
If not force the server to use binary mode as i suggested above... although i haven't explained well, why all this happens... .
penpen
Edit:
But you two are right, it could also be fixed by using ascii transfer mode, but this assumes that the server IS reconstructing the ascii data when downloading in ascii mode (there is no guarantee that the server behaves in this way).
Btw: The function DownloadFile of System.Net.WebClient is using the default browser to download unknown files and known non-text files using binary mode and known text files using text mode.
Most servers in inet don't reconstruct the html files, that are downloaded in text mode.
So just try to save the file as a "txt" file on the server, and try out if it reconstructs the line breaks.
Re: FTP - in one batch file?
Yeah that's what I meant. Thanks for explaining more clearly.
Re: FTP - in one batch file?
foxidrive wrote:Rydell wrote:then verify it was downloaded(but not its integrity)? If so, the following works for me:
IF EXIST "C:\Program Files\MyProgram\MyProgram.exe" echo File Downloaded.
IF NOT EXIST "C:\Program Files\MyProgram\MyProgram.exe" echo File Not Downloaded.
It could be a zero byte file, so that check is pretty pointless.
I figured what they were asking made it pretty pointless, that's why I said "and not an integrity check?" But, are we worried the file will only half download or something?
Re: FTP - in one batch file?
OK, aGerman and penpen I will give that a try .
penpen, do you know all those languages that YOU, YES YOU CAN CODE with? Or are you just listing the NAMES of languages you
know. I can also list a lot of languages, duh?
I meant what languages do you know that you can code with?
penpen, do you know all those languages that YOU, YES YOU CAN CODE with? Or are you just listing the NAMES of languages you
know. I can also list a lot of languages, duh?
I meant what languages do you know that you can code with?
Re: FTP - in one batch file?
Languages than i can use without thinking too much:
commodore basic, batch, turbo pascal, logo, c, c++, assembler, html, xml, (xhtml,) javascript, java, latex, perl, matlab, haskell, lisp, c#, vbs, jscript, powerscript, svg
(This should be the chronology order i had learned them.)
The language that i am able to use, but with headache:
b r a i n f u c k
All others i have to do some lookup, although the syntax may look familiar, so reading the code is no (big) problem to me (except whitespace for this i have first to replace some characters to be able to read it).
penpen
Edit: My favorites are C++, Java, and the weblanguages (html, xml, xhtml, javascript, svg)
commodore basic, batch, turbo pascal, logo, c, c++, assembler, html, xml, (xhtml,) javascript, java, latex, perl, matlab, haskell, lisp, c#, vbs, jscript, powerscript, svg
(This should be the chronology order i had learned them.)
The language that i am able to use, but with headache:
b r a i n f u c k
All others i have to do some lookup, although the syntax may look familiar, so reading the code is no (big) problem to me (except whitespace for this i have first to replace some characters to be able to read it).
penpen
Edit: My favorites are C++, Java, and the weblanguages (html, xml, xhtml, javascript, svg)
Last edited by penpen on 30 Sep 2013 06:30, edited 1 time in total.
Re: FTP - in one batch file?
So how long have you been studying these? Did you go to university? When did you start?
Re: FTP - in one batch file?
1) it took me round about 22 years, so nearly 1 language per year.
2) Yes, i did. But commodore basic, batch, turbo pascal, logo, c, c++ assembler i have learned prior.
3) Since i was 14 (commodore basic), since 16 the others.
Btw: You may also use private message system.
penpen
2) Yes, i did. But commodore basic, batch, turbo pascal, logo, c, c++ assembler i have learned prior.
3) Since i was 14 (commodore basic), since 16 the others.
Btw: You may also use private message system.
penpen