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)
using client side images?
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
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
)
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
the local filesystem can be accessed via file:///<path>
let's say you have a graphic pack likeBut 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...
let's say you have a graphic pack like
- graphics/
- background/
- main.png
- ...
- monster/
- beholder.png
- ...
- ...
- background/
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" />
...