graham23s Posted May 25, 2007 Share Posted May 25, 2007 Hi Guys, when using the get_file_contents function i allow users to upload doc and txt files, but i have noticed when PHP hits unusual character in the doc or txt files it, doesn't upload properly, is there a way i could strip all the extra characters and just have text from the file? $filename = $files; $content = file_get_contents("uploaded_files/$filename"); $files_for_mysql = mysql_real_escape_string($content); thank guys Graham Link to comment https://forums.phpfreaks.com/topic/53007-solved-file_get_contents/ Share on other sites More sharing options...
ToonMariner Posted May 26, 2007 Share Posted May 26, 2007 ??? why do you need that just to allow users to upload a file? if you are storing the file in a database then you store in a blob field - there are plenty of examples such as this http://www.phpbuilder.com/columns/florian19991014.php3 to do just that. otherwise just upload the file to a directory. Link to comment https://forums.phpfreaks.com/topic/53007-solved-file_get_contents/#findComment-261911 Share on other sites More sharing options...
graham23s Posted May 26, 2007 Author Share Posted May 26, 2007 Hi Mate, solved thank mate Graham Link to comment https://forums.phpfreaks.com/topic/53007-solved-file_get_contents/#findComment-261999 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.