Checking for a .csv file
Posted: Thu Jul 05, 2012 2:51 am
I'm creating a script that will allow csv files to be uploaded; my problem is how to determine that the uploaded file is actually a .csv file. Found the url below and it has a few interesting points;
http://stackoverflow.com/questions/6654 ... csv-format
The option that stands out for me at this point is to validate the data in the file by using regular expressions - but i'm not sure if this is a workable option. The uploaded files will contain at least 1000 "records" at a time so using regex will probably slow things down significantly
Any ideas or suggestions on how to validate a csv file before uploading it?
http://stackoverflow.com/questions/6654 ... csv-format
The option that stands out for me at this point is to validate the data in the file by using regular expressions - but i'm not sure if this is a workable option. The uploaded files will contain at least 1000 "records" at a time so using regex will probably slow things down significantly
Any ideas or suggestions on how to validate a csv file before uploading it?