Page 1 of 1
using client side images?
Posted: Sun May 11, 2003 8:21 am
by Coco
Doubtless this has been asked before (i tried phuse but it didnt come up with anything useful)
What i want to be able to do is to allow users to download a graphics pack (with the aim of saving on longterm bandwidth)
Obviously tho, my scripts need to be able to access these graphics. So, is it possible to access client stored images? if so how?
(i only want to access them for html, the script itself wont access them for any other purpose)
Posted: Sun May 11, 2003 11:08 am
by phice
Not possible.
Instead of trying to save images to the user's hdd, what would stop one from saving a virus to the user's hdd. Security.

Posted: Sun May 11, 2003 2:05 pm
by Coco
yeah but i thought it wasnt possible to have viruses in jpeg and gif type files?
im not saying the script itself saves the images there, the user does that, what i want to do is to read the images, nothing else
Posted: Sun May 11, 2003 2:12 pm
by twigletmac
if you could get people to put the images in the same place - or had a bit on your site where they could say where they put them and you stored a cookie with that info - then you could have your image paths changed to things like C:\cocos_images\ to grab them off the local machine.
Mac
Posted: Sun May 11, 2003 2:20 pm
by volka
many browser-games do so. The local path is stored along with the account-informations and the user has to enter the path.
remember: it's not the script that displays the images, it's the client (browser). The html-document (generated by the script) only has to tell the client where it can find the images.
Make sure users can change these settings even if they've entered the wrong path previously (pure graphical navigation isn't helpful at this state

)
Posted: Sun May 11, 2003 3:59 pm
by Coco
great

so i can just use file paths like windows does when its using IE in explorer mode?
and funnily enough, it is for a browser game

im intending to make a php version of master of orion 2... and then build on it from there til i have something thats not liable to copyright infringement
Posted: Sun May 11, 2003 4:56 pm
by volka
the local filesystem can be accessed via file:///<path>
let's say you have a graphic pack like
now you fetch the account infos and check wether the user has entered a local path
Code: Select all
<?php
$info = getUserAccountInfo(); // whatever this is
if (!isset($info['path']))
$info['path'] = 'http://my.ho.st/data';
// supposed to be something like file:///C:/brwosergame1 if set
...
?>
...
<img src="<?php echo $info['path']; ?>/graphics/monster/beholder.png" alt="a beholder" />
...
But you cannot check wether the path is correct. If not, the user will see no graphics. Therefor do not forget the
alt-property and do anything to keep a minimal navigiation working in case the user fails...