Hi,
I have a word document in a non-root folder and I wrote a code that allows users to download the file. Code is
rename ("../cgifolder/docxfile.docx","docx/docxfile.docx");
header("Content-disposition: attachment; filename=docxfile.docx");
header('Content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document');
readfile("docx/docxfile.docx");
I have two questions ...
1. I am seeing that downloaded content a corrupt file while file on server is MS2010 readable. What is wrong with my code?
2. Can I place files in cgi without renaming it to move to root folder and still allow users to download the file
Thank you