Characters in an uploaded text file being corrupted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Using the following bit of code, I am then saving the contents of an uploaded text file into a mysql database, but, the issue seems to be that immediately after retrieving the contents of the temporary path of the uploaded file, for example, things like ' characters are rendering as ? characters in the assigned variable..?

//start of code segment
if (isset($_FILES["filContent"])) {
if ($_FILES["filContent"]["type"] == "text/plain") {
$ltContents = file_get_contents($_FILES["filContent"]["tmp_name"]);
}
}
//end of code segment

I am guessing that it's either due to something to do with upload part of process - form tag is using post method, and has enctype set to multipart/form-data - or else, it might have something to do with the server handling character encoding or something..?

This is currently being run/tested under WAMP, on a windows7 64 bit machine, FWIW.

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux