Jump to content

read and display a word document


mona

Recommended Posts

hi, I tried to read and display a word document using the following style: $fo = fopen('somefile.doc', 'r'); $read = fread($fo, filesize('somedoc.doc')); fclose($fo); echo $read;Also I tried another one $read = file_get_contents('somedoc.doc'); echo $read; both ways are working in the localhost way, that is using my own apache and php on my laptop especially that the doc files are already saved on my computer.but in my case, I took my files and put them on another server (not localhost) and I tried to access the website from my computer, all my project is working except the reading of files, why?Is it because the files are not saved on the server and they are saved on my computer?Is there a way to open and read these files from the server?

Link to comment
Share on other sites

According to the script as you have it there, the script will be looking for the files to be in the same directory as the script, so, yes, upload the files to the server and into the same folder/directory as the script which is reading them.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...