I'm using a form's POST method to allow a user to upload a file consisting of 33 lines of comma-separated values. There are a fixed number of fields on each line (3, in the test file).
When I use FTP to upload the file, it works fine and PHP recognizes the correct number of records and fields. It nicely spits out the data in my specified format -- 33 lines of 3 columns each.
But when I use the on-line form to POST the same file via the web browser's interface, then using the PHP copy() function to move it into the web directory structure, PHP renders the table as a single row of 99 columns. Has it lost its line endings?
If I then use FTP to download that puzzling file and simply re-upload it -- still using FTP and without editing it -- it gets parsed correctly.
What am I missing?
Thanks in advance!