Hi all, i need some help with php. I am writing i web site and i have an upload form . I upload files in folder and in database where i have the filename the path and some other fields which i will use for
my sql to set my needed files. I need help with a reader. after a get a list with the files from the sql i use the file path as link. I want when i click this link to open the file in my page and to read it and save it. The problem is that that i set to upload only pptx, ppt and pdf file. Can anyone help me with a source code of a reader and how to make the connection between the file path and the reader, because now if i click the path and i download the file.
thanks in advance

Recommended Answers

All 2 Replies

The simplest way is to provide a link or a button with a link to the file. It will open the file in the browser (or download depending on the browser and what they choose to do). You don't want to read the file content and actually display it yourself, you let the browser or their local program take care of it.

A slightly more sophisticated version:

ok, the idea for ppt and pptx viewer is probably a little advance for me at this point. I write php code for two mounts now :D so let leave only the pdf. Can i have a div frame with some size and inside to open pdf files with some help from php or js in a window. Because under this div i will have another one with the list of filepath from where to open it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.