I am facing a problem while saving a .csv file from browser.
I made a file myfile.csv and added rows into it from my database, and i asked the users to right click and save the page. But in many browser (because some browsers want to add the .txt properties to it) it is getting saved as myfile.csv.txt format.
Most people wouldn’t know to delete the .txt part from the file name so can this be adjusted to always be a .csv format?
can i add a directive to the .htaccess to recognize .csv files? Not sure though.
Please let me know what you think how this can be done.
Any help/idea would be appreciated.
Thanks in advance.
Could be a MIME type issue. Browsers sometimes have the habit of inconsistently using either the file name (extension) or MIME type, but ignoring the other. Since different browsers handle it differently you should make sure they match if you want it handled properly.