Page 1 of 1

Calling a PDF from a windows file server from a linux/php ap

Posted: Thu Apr 27, 2006 8:55 am
by phillipsd
We are trying to call a PDF from the marketing server (Windows) from
an php web application on a linux server through the web browser and
it keeps returning the error file not found.

We have created a symbolic link in the base diretory where the php
file calling the pdf is held, this links to the mounted drive (mounted from
the windows file server thats holds the pdfs) the windows directories
files names use hashes and spaces and i have replaced them with ascii
characters yet its still not calling the pdf out.

Are there any issues i should be aware of when calling a pdf this way?

David Phillips

Posted: Thu Apr 27, 2006 9:02 am
by feyd
Can your php script read the directory (symlink) for files? opendir()-readdir() or glob() may be of interest for testing this.

Posted: Thu Apr 27, 2006 9:16 am
by phillipsd
feyd wrote:Can your php script read the directory (symlink) for files? opendir()-readdir() or glob() may be of interest for testing this.
Just tried it and yes i can read the directory fine using the above commands
the hard coded string works the dynamically generated one won't read. The
dynamic link created by the concatenation of php values from the previous page
when cut and pasted works but the orginal variables shown below don't.

$pdf_url = "/" . str_replace("","/", $pub_dir_clean) . "Low res pdf/";

David P

Posted: Thu Apr 27, 2006 9:41 am
by feyd
So $pdf_url is absolutely correct relative to the server's file system paths? The way it is written, whatever is in $pub_dir_clean would have to be in the root of the server, not in the root of the web document root.

Posted: Thu Apr 27, 2006 9:49 am
by phillipsd
feyd wrote:So $pdf_url is absolutely correct relative to the server's file system paths? The way it is written, whatever is in $pub_dir_clean would have to be in the root of the server, not in the root of the web document root.
its basically

$pub_dir_clean is the name of the cleaned variable and string text is the folder
though one of the folders

$pdf_url = $pub_dir_clean . "string text"

even when i hard code the url to the actualy pdf i am trying to open it return as file not
found even though the directory Low res pdf can be read.

path /s/FLIERS/Savers/Savers2-April06/Low res pdf/Savers2_11.pdf
urlencoded path %2Fs%2FFLIERS%2FSavers%2FSavers2-April06%2FLow+res+pdf%2FSavers2_11.pdf


David P

Posted: Fri Apr 28, 2006 8:02 am
by phillipsd
feyd wrote:So $pdf_url is absolutely correct relative to the server's file system paths? The way it is written, whatever is in $pub_dir_clean would have to be in the root of the server, not in the root of the web document root.

I sorted it using the header commands


Fuzzygoth