[Geomoose-users] Open an Image
Dan Little
danlittle at yahoo.com
Mon Dec 29 10:39:13 EST 2008
Jay,
This type of request is really, really, really bad practice:
1) It shows the full path to the storage of all of your images.
2) That path is relative to the computer you are USING not the computer where you have the images stored.
You should really have a PHP script like the following (put it in the htdocs/php folder and name it "getSketch.php" or something intuitive):
<?php
$sketchName = $_REQUEST['sketch_name'];
header('Content-type: application/pdf');
readfile('c:/ms4w/apps/GeoMOOSE/htdocs/pdf/Assessing_Sketches/'.sketchName);
?>
And the hyperlink should look like this... (assuming [SKETCHNAME] is the field containing the unique ID in a mapserver template file of some sort).
<a href="php/getSketch.php?sketch_name=[SKETCHNAME]" target="photowindow">View Sketch PDF</a>
Or if you must use the javascript windows...
<a href="javascript:window.open('php/getSketch.php?sketch_name=[SKETCHNAME]', 'photowindow', 'width=450,height=350')"> View Sketch PDF</a>
________________________________
From: Jay Kapalczynski <jkapalczynski at ci.maple-grove.mn.us>
To: "geomoose-developers at lists.sourceforge.net" <geomoose-developers at lists.sourceforge.net>; "geomoose-users at lists.sourceforge.net" <geomoose-users at lists.sourceforge.net>
Sent: Monday, December 29, 2008 9:27:09 AM
Subject: [Geomoose-users] Open an Image
I am having a problem here…
I have two different locations where I am storing my
imagery. As seen below with the two different paths.
I verified that the image is present in both locations, and
that the path names are correct….but for some reason I cannot get the
image in the C drive to open. The image located in the S drive opens fine.
Can anyone see why that may be….is there some sort of
syntax issue with storing the files within the ms4w folder?
Not working
$p_hype2 =
"javascript:window.open('file://C:/ms4w/apps/GeoMOOSE/htdocs/pdf/Assessing_Sketches/".$p_name2."','photowindow','width=450,height=350')";
Working
$p_hype2 =
"javascript:window.open('file://S:/GeoImag/Assessing/Sketches/".$p_name2."','photowindow','width=450,height=350')";
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20081229/46a674d4/attachment.html
More information about the Geomoose-users
mailing list