Jump to content

PHP uploads and Word files


themistral

Recommended Posts

Hi guys,

 

I am having a problem with either uploading or viewing a Word (.doc and .txt) file.

 

I use a form with multipart/form-data enctype to upload the file. I also parse the filesize, filetype and filecontent to a database. All is added to the database fine. After reading a few things on the internet it seemed I should use blob rather than text for the field type holding the content of the uploaded file.

 

However, when I view the contents, I get lots of extra characters at the top and bottom of the 'real' content. I have played around with charsets but to be honest, don't really know what I'm doing - and I haven't been able to make it any better!

 

There is no way we can change the Word file to HTML or import it into Dreamweaver as our clients will be uploading their own files - so we need to be able to strip these characters out via the website.

 

I hope that is explained OK but if anything is not clear, I will try and explain a bit further!

 

Here's hoping someone can help!  :)

Link to comment
https://forums.phpfreaks.com/topic/74738-php-uploads-and-word-files/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.