Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreadable content #482

Closed
tskkh opened this issue Feb 19, 2015 · 5 comments
Closed

Unreadable content #482

tskkh opened this issue Feb 19, 2015 · 5 comments

Comments

@tskkh
Copy link

tskkh commented Feb 19, 2015

Hi,
I am using PHPWord in my web application. First it really works fine but after I update my composer,
I still export it but the content is unreadable like this :

PK########�JSFP_O��;###<######word/media/section_image1.png<�#p&]#.�ƶm�N�ض5�m۞ض��m��Ll���ϩs�jWu��^ս�Z#�W���$#,.,##@��#S##@#�#�Р��#~�##�#i1a5Ϝ�#��_��#mς'�ق�#G#��[���ٗe(#�2(E�j��{���d���#�V&#���(ٗ�\�###�Tѷ���#oN?#���#��#���#��(� hr�̷:}���5#�#tU9�#�|�O3���s��R����3��y��

@ghost
Copy link

ghost commented Feb 19, 2015

Hi @tskkh.

Sorry, what did you do?

@tskkh
Copy link
Author

tskkh commented Feb 20, 2015

Hi,
I use PHPWord to download document as word office.

@ghost
Copy link

ghost commented Feb 20, 2015

I meant "What did you do with composer"? You updated composer itself or you updated version of PHPWord?

@tskkh
Copy link
Author

tskkh commented Feb 23, 2015

I updated composer only.
It seems there is the problem on header because it works fine for saving, but not working for downloading.

This is my header for download using phpword:

$filename 'test.docx';
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$filename);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($filename));
flush();
readfile($filename);
unlink($filename);
exit();

@ghost
Copy link

ghost commented Feb 25, 2015

The file is broken because of download? Is it readable BEFORE download? Please, try to download it with some tools (not with your PHP code) and check.

@ghost ghost self-assigned this Mar 1, 2015
@ghost ghost closed this as completed Oct 22, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant