I have a simple upload form to upload txt files, then I use

$text = fread($fp, filesize($tmpName));

to store the content.

Uploading txt files works great, the only hickup is that special characters such as èà etc... don't show up.

Please help, I'm not exactly sure how to correct this.

    I'd suggest simply using [man]file_get_contents/man instead of fread().

      Might also be an encoding issue; how was the .txt file encoded? If it was encoded as UTF-8 and the default charset in PHP is set to iso-8859-1, you'll have problems.

        Write a Reply...