I'm writing an Android app that posts some CSV formatted data to a PHP server.
If I only post one row, the server reads it correctly and does what it needs to do. However, I'm unable to post multiple lines. I have the CSV data in a .txt file and I read this data into a string and send that string using HttpURLConnection. The issue is that while it'll look fine looking at the .txt file in my phone, the server does not interpret "\n" or "\r\n" correctly and won't update at all. My guess is that it interprets the entire string as one line or something along those lines.
Each line sent is read like this:
list($value1, $value2, $value3) = explode(",", $datarec);
Is there some sort of newline character that PHP can recognize? Apparently, it doesn't recognize \n or \r\n.
I currently have the content-type set to text/csv but I've also tried text/html and using br/> instead.
conn.setRequestProperty("Content-Type", "text/csv");