SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Feb 2001
    Location
    Shanghai, China
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, couldn't find this in my books. Why do I have to user ASCII - Modus for the transfer of PHP Sites and binary for the rest. I never did this before and it always worked fine (nearly fine).

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All pages including php, html, asp, coldfusion, perl should be uploaded in ascii mode. The reason you probably haven't had a problem with straight html pages is because you don't really need to preserve the line breaks in html, your whole html file could be all on one line. Now I am not really sure why, I think it has to do with the line breaks but most php, perl scripts and I am assuming asp and coldfusion pages will need to be uploaded as ascii to preserve their layout. Don't ask me why, because I don't know the exact answer, I am sure someone here will though.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is a good explanation:

    "What is the difference between ASCII and Binary?" (scroll down a bit)
    http://www.connix.com/bizpages/ftp.html

  4. #4
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Unix systems have only one character: LF to signal the end of a line, but DOS/windows systems have two: CR carraige return and LF line feed.

    When uploading or downloading in ASCII mode, the operating system receiving the file knows to translate the line breaks into the one most used in its operating system.

    Whether this matters depends on your server OS and the application that is parsing the text file.

    I am hosted on a Linux/Apache server with PHP. My PHP scripts can run no matter whether they have the extra CR, but the perl scripts hang if it has them.

    The CR is also called a CTRL-M or #13 or %0D, it is the thirteenth ascii character.

    If both computers have the same OS, ie they are both Unix-Based or both DOS/Windows based, then you don't need ascii transfers ever.


    [edit] qslack you beat me to it!
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •