php-windows Digest 3 Nov 2004 09:32:45 -0000 Issue 2452
Topics (messages 24871 through 24872):
Re: Displaying An Image / Non-Web accessible Dir
24871 by: Armando
Re: apache config question
24872 by: phpWalter
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi Jason,
I wonder if permissions are my problem, but... When I try and fopen the
file (using rb flags for read and binary) and try to do an fstat it
doesn't return any of the specific file information at all (lots of
zeros). I'm running Apache 2.0.51 under the LocalSystem account, and so
I assume that PHP which is loaded as an Apache module would attempt to
access the file as whatever user the Apache service is using. In which
case LocalSystem SHOULD have access. It's frustrating because I know I'm
probably missing something simple!
Armando
-----Original Message-----
From: Jason Barnett [mailto:[EMAIL PROTECTED]
Sent: November 2, 2004 7:13 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Displaying An Image / Non-Web accessible Dir
> Can you or someone suggest how I can access an image file on my drive
> which is not part of the http-accessible directories (say in
> C:\images\somepic.jpg) and display the filetype? I think once I can at
> least get that to work, the rest should be fairly simple.
If all goes well, the only thing you should need to do to open that file
would
be to open a file with a file pointer and then do whatever you want with
the
file pointer. Your PHP user will need read and / or write access to the
file(s)
in question, you can right-click them to check on this.
<?php
// any file, so long as PHP user can read it
$file = 'C:\\images\\somepic.jpg';
$fp = fopen($file, 'r');
// do stuff, not sure what you wanted ewxactly but this gives you an
idea echo 'Is this a directory? '; echo is_dir($fp) ? 'yes' : 'no';
echo '<pre>'; print_r(fstat($fp)); echo '</pre>'; // etc.
?>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
> How do I set up permission to access folders and not only specific files
> in these folders with apache...? I can't find the correct line in
> httpd.conf
Folder and file access is controled at the OS level.
Walter
--- End Message ---