Thanks for your patience, BJ, but I think I have not explained the problem
well. Here is more info:

The webserver is Linux running php 4.2.3
Uploaded files are csv

Scenarios
1) upload csv from mac using ftp set to "text": works
2) upload csv from mac using ftp set to "raw data": fails
3) upload csv from mac using html form: fails
4) upload csv from pc using html form: works

In each case the csv file is the same file, and the failure is that the line
endings don't seem to be recognized and all the csv lines run together
making one honker record. From the tests above, I can see that the script
works fine if the file is uploaded from the pc, or as "text" from the mac.
This implies that the server is correctly recognizing the line endings when
the file is in the right format. It also implies that uploading from the mac
using an html form is not in "text" format. Using

$infile = str_replace("\r", "\r\n", $infile);

did not help. 

I doubt anyone will be using a mac for this service, but it would be nice to
figure out.

thanks,
steve




> From: "Bj" <[EMAIL PROTECTED]>
> Organization: Sunshine Graphics
> Reply-To: [EMAIL PROTECTED]
> Date: Thu, 5 Feb 2004 21:27:13 -0000
> To: [EMAIL PROTECTED]
> Subject: [wdvltalk] Re: uploading files
> 
> Light possibly dawns, i am so used to Linux servers... but if you have a
> Windows server, it'll want to see crlf at the end of a line, = CR (carriage
> return or \r) followed by LF (linefeed, also known as newline or \n), and
> won't understand Linux (and maybe Mac) using just a newline (\n).  If so,
> you need to do a global replace on the file before processing it, replacing
> all '\n' with '\r\n'
> 
> $infile = str_replace("\r", "\r\n", $infile);


____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set 
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

Reply via email to