The intent of this is to have users submit applications to the client and for the client to review their information and select the best application. I am trying to display a document from a file server onto the php web page. MySQL code holds the path of the file and I'm using readfile(). I thought maybe it was the encoding or maybe it was the file type but nothing I do seems to be working. I tried using a different filetype and I tried using mb_convert_encoding to modify the encoding.
<?php foreach ($applications as $application) : ?> <p> Name: <?php echo $application['fname']; ?> <?php echo $application['mname']; ?> <?php echo $application['lname']; ?><br /></p>
<?php
readfile ($file); ?>
<?php endforeach; ?>
Here's an example of the symbols that are displaying:
PK!���Ʌ)[Content_Types].xml �(�̕MK�@���!�U�m+�H��8j� ^��I���N�������Vۊ�@23���0;� �F'sQ9��N�f X�re'{=��YQ�\hg!c+�l�??�VbB�6fl��o8�r F��y�)\0�5L��ML�w��+.�E���R��{wP����~I�k�:��N,�2&��J �8����Kk�Re����J|�C��]�D� *�d(> CY|�B�s'g�*��28]Q( M}�惓#��贉���&9��̫�!�ap>v�iDK=������p���LD\i�ǟ�Zw�= R�)��;0~>�'� ���X��1�H�������fI����v �8���,�[~��oI���A��s��]�#�� �������PK!�U~��_rels/.rels �(���MK1���!̽;�"��^D�Md�C2��������(�.Ե�3y��3C֛��+�4xW��(A������yX܂JB���Wp����b��#InJ�����E�b�=[J���M�%���a �B�,o0�f@=a��� n�����o�A��;�N�
The file I'm trying to read is .doc file.
readfile()doesn't work that way. It works with output buffers. Reply is complex to write as it relies on many factors. Please see this topic: stackoverflow.com/questions/2028898/… It's the same thing except it usesfopeninstead.readfilein this straight-forward way. See en.wikipedia.org/wiki/Office_Open_XML_file_formats for how they're built.