Re: Displaying An Image / Non-Web accessible Dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux