Bob Bedford wrote:
Quote:
Quote:
>Put it in a zip file?
>
Hi R0g,
>
thanks for your suggestion.
>
People that use the site may be good enough to follow the procedure to
download images (everything is explained) but some may be unable to "unzip"
files.
>
Ideally, the script should show the "save as" message and let people save
the file. If I don't use the <IMGtag, the file will be proposed for
saving, isn'it ? or should I use an other way (maybe javascript).
>
Bob
>
>
If you send it as a picture type most peoples browsers will just display
it. AFAIK you can't force their browser to offer a save as dialog.
Certainly not with PHP as it is server side only. If you are determined
you may be able to provide your own dialog using client side code but
this would, to the best of my knowledge, require you to embed an activeX
or java program in your site. AFAIK there's no reliable way to do this
with Javascript.
A simple alternative is to use a file type people's browsers won't
automatically open such as zip. Every OS can read zip files natively.
People who may not be aware of what zip is will most likely try to view
the file by double clicking it, thereby launching the OS's zip decompresser.
Even this isn't foolproof though, your clients will probably still get
the option to 'open' it rather than save it and if they do* it will be
opened from the browsers temporary folder and probably lost later.
So you really have 3 choices.
1) Code up some Java to do this (and hope they have Java installed)
2) Try the method I suggested above
3) Possibly the best... Provide verbose and clear instructions on the
download page. If you want to be extra clear then make your script
detect their platform/browser so you can direct them to...
"Right Click - Save Link As" in firefox
"Save link as" in Chrome
"Save target As..." in IE
"Click and hold" on the Mac
etc etc.
Regards,
Roger.
* People will always try what to you may seem like dumb options if you
give them those options! Most people, including those that use computers
every day, aren't computer literate and it's a miracle of UI design they
can and do get by fine anyway :-)