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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phillipsd
Forum Newbie
Posts: 4
Joined: Thu Apr 27, 2006 8:45 am

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

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Can your php script read the directory (symlink) for files? opendir()-readdir() or glob() may be of interest for testing this.
phillipsd
Forum Newbie
Posts: 4
Joined: Thu Apr 27, 2006 8:45 am

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
phillipsd
Forum Newbie
Posts: 4
Joined: Thu Apr 27, 2006 8:45 am

Post 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
phillipsd
Forum Newbie
Posts: 4
Joined: Thu Apr 27, 2006 8:45 am

Post 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
Post Reply