uploaded .txt file returns filetype as application/x-csv?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
LN Tora
Forum Newbie
Posts: 1
Joined: Mon Jun 26, 2006 11:06 am

uploaded .txt file returns filetype as application/x-csv?

Post by LN Tora »

Hello. First, I honestly did search both php.net and the forums, but I'm not sure if I'm phrasing my search right, and I'm getting more confused than ever.

I'm currently using a fiction archiving script, eFiction, that allows file uploads. Looking at the code, it allows only filetypes matching text/plain and text/html. I thought text files with the .txt extension were plain text, yet when I tried uploading one, it returned an invalid file type error. I made a quick upload script to read the file type for the text files, and that says application/x-csv. So I'm wondering if this is correct, and if so, should I just mod to script to allow this type as well, or figure a way to get the file extension instead and allow files that way?

Any help on this matter is greatly appreciated. Thank you.
Post Reply