> I have a form that allows someone to upload a text file, the contents of > which will be inserted into the database. When I fread() the file, there > is > some garbage at the beginning and end of the text. > > Here's what the text looks like: > > This is the sentence of text. > > Here's what it looks like after uploaded and fread(): > > *ch?¡®ºdä?º†Ím This is the sentence of text.SORT~€ÿÿ > > > The text file being uploaded is a BBedit file, which should be a plain > text > file. I'm not sure where this garbage is coming, and if there's an easy > way > to remove it before I put this into the Database. I searched the PHP help > files for an hour and searched here, and couldn't find anything related. > > I'm using PHP 4.2.3 on a Redhat Linux server. > > Thanks.
Are you using Apache2? IIRC, there was a bug where data would get added to the POST data, or something along those lines... What if you just look at the file with a regular text editor? Do you see that data there after it's uploaded and written to the server, or does it just appear into the data when it's fread()? ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php