My situation is really weird. Everything is working as expected but I have a question.
I am transferring a .csv file from my server to another server using a PUT HTTP command.
On the second server I am using
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
//Putting into the database
}
to parse the csv file and insert each row in the database.
My question is.
If I send the .csv file as a binary file in order to reduce network overhead. How will I modify the way I am reading the csv file from binary format in order to parse it?
Finally, what about the processing power and time overhead to first parse the binary file again to csv?
There is no real difference between binary files and text files, apart from some multibyte encoding and human-readableness. The letter A in most encodings is stored as a byte with the value 65, and there is no way to ‘convert’ this to binary since it already is.
What you’re looking for is compression. You might want to look at
gzip()ing your output.