I've to build a website where the customer can buy an image. I'm thinking in
the 2 ways to let people get those images: receive them by Email or send
them an image link wich validity is limited in time.
The second may help me to know if an image has been downloaded and how many
times.
How to build such download link ?
The informations I'd like is the userid, the datetime limit and the
imagefile, off course everything must be encrypted enough not to let other
people create new links.
Putting the datetime limit in the link allow me not to save this information
in a database. Arriving in the linked script will automatically check the
datetime limit.
I know how to show the picture, that's easy. Now how to make the user
download the image automatically ? not showing the image but instead making
him to "download" the file.
Thanks for advising me about this.
Bob 12 3889
Bob Bedford wrote:
I've to build a website where the customer can buy an image. I'm thinking in
the 2 ways to let people get those images: receive them by Email or send
them an image link wich validity is limited in time.
The second may help me to know if an image has been downloaded and how many
times.
How to build such download link ?
The informations I'd like is the userid, the datetime limit and the
imagefile, off course everything must be encrypted enough not to let other
people create new links.
Putting the datetime limit in the link allow me not to save this information
in a database. Arriving in the linked script will automatically check the
datetime limit.
I know how to show the picture, that's easy. Now how to make the user
download the image automatically ? not showing the image but instead making
him to "download" the file.
Thanks for advising me about this.
Bob
Put it in a zip file?
Bob Bedford wrote:
I've to build a website where the customer can buy an image. I'm thinking in
the 2 ways to let people get those images: receive them by Email or send
them an image link wich validity is limited in time.
The second may help me to know if an image has been downloaded and how many
times.
How to build such download link ?
The informations I'd like is the userid, the datetime limit and the
imagefile, off course everything must be encrypted enough not to let other
people create new links.
Putting the datetime limit in the link allow me not to save this information
in a database. Arriving in the linked script will automatically check the
datetime limit.
I know how to show the picture, that's easy. Now how to make the user
download the image automatically ? not showing the image but instead making
him to "download" the file.
Thanks for advising me about this.
Bob
If they can display the image, they've already downloaded it and can
save it.
However, you can't "make" him download the image - that's up to the
browser settings. All you can do is recommend downloading the picture;
To do that, your script needs to check the time limit, and if it's
within the appropriate headers, i.e.
header('Content-disposition: attachment; filename=image.gif');
header('Content-type: image/gif');
readfile('image.gif');
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
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 they can display the image, they've already downloaded it and can save
it.
However, you can't "make" him download the image - that's up to the
browser settings. All you can do is recommend downloading the picture;
To do that, your script needs to check the time limit, and if it's within
the appropriate headers, i.e.
header('Content-disposition: attachment; filename=image.gif');
header('Content-type: image/gif');
readfile('image.gif');
--
Hi Jerry,
thanks for your suggestion. I've to do a "you can't do simple" way. Most
people don't know how to do a "right click" and then "save as". Also Mac
users don't have a "right" button.
Also I can't ask people to change their settings. Ideally the script should
propose the file as "save as...".
Bob
Hi Bob,
I think that you'll find this comment helpful: It looks like a pretty
bulletproof way to force a file download, just tweak it to work with
these images rather than .xls files. http://us2.php.net/manual/en/function.header.php#83384
Thomas
On Sep 23, 1:24*pm, "Bob Bedford" <b...@bedford.comwrote:
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
Bob Bedford wrote:
>If they can display the image, they've already downloaded it and can save it.
However, you can't "make" him download the image - that's up to the browser settings. All you can do is recommend downloading the picture;
To do that, your script needs to check the time limit, and if it's within the appropriate headers, i.e.
header('Content-disposition: attachment; filename=image.gif'); header('Content-type: image/gif'); readfile('image.gif');
--
Hi Jerry,
thanks for your suggestion. I've to do a "you can't do simple" way. Most
people don't know how to do a "right click" and then "save as". Also Mac
users don't have a "right" button.
Also I can't ask people to change their settings. Ideally the script should
propose the file as "save as...".
Bob
The code I gave you is the best you're going to do. You can't force it;
you can only recommend. And that's what the code does.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
Hi Thomas
>"703designs" <th**********@gmail.coma écrit dans le message de news: 0b**********************************@k7g2000hsd.g ooglegroups.com... Hi Bob,
I think that you'll find this comment helpful: It looks like a pretty bulletproof way to force a file download, just tweak it to work with these images rather than .xls files.
http://us2.php.net/manual/en/function.header.php#83384
Great source, this is exactly what I were looking for.
Thanks a lot !
Bob
Hi Jerry,
The code I gave you is the best you're going to do. You can't force it;
you can only recommend. And that's what the code does.
....and that's why I'm gratefull about your help, that I appreciate a lot.
Thank you.
Bob
On Sep 23, 12:47*pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Bob Bedford wrote:
I've to build a website where the customer can buy an image. I'm thinking in
the 2 ways to let people get those images: receive them by Email or send
them an image link wich validity is limited in time.
The second may help me to know if an image has been downloaded and how many
times.
How to build such download link ?
The informations I'd like is the userid, the datetime limit and the
imagefile, off course everything must be encrypted enough not to let other
people create new links.
Putting the datetime limit in the link allow me not to save this information
in a database. Arriving in the linked script will automatically check the
datetime limit.
I know how to show the picture, that's easy. Now how to make the user
download the image automatically ? not showing the image but instead making
him to "download" the file.
Thanks for advising me about this.
Bob
If they can display the image, they've already downloaded it and can
save it.
However, you can't "make" him download the image - that's up to the
browser settings. *All you can do is recommend downloading the picture;
To do that, your script needs to check the time limit, and if it's
within the appropriate headers, i.e.
header('Content-disposition: attachment; filename=image.gif');
header('Content-type: image/gif');
readfile('image.gif');
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================- Hide quoted text -
- Show quoted text -
Jerry
I just noticed the part about the header, this may resolve an issue I
have been having streaming images out. I want to set the mime type in
the header and also send the size so Flash knows how big it is, but it
would never let me do more than one "content" in the header tag. I
tried seperating them with "\n" like I would do in perl, but now,
after seeing what you posted, it dawned on me that you can use
multiple header()'s instead of combining them into one. Is that so?
Bill H
Bill H wrote:
On Sep 23, 12:47 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
>Bob Bedford wrote:
>>I've to build a website where the customer can buy an image. I'm thinking in the 2 ways to let people get those images: receive them by Email or send them an image link wich validity is limited in time. The second may help me to know if an image has been downloaded and how many times. How to build such download link ? The informations I'd like is the userid, the datetime limit and the imagefile, off course everything must be encrypted enough not to let other people create new links. Putting the datetime limit in the link allow me not to save this information in a database. Arriving in the linked script will automatically check the datetime limit. I know how to show the picture, that's easy. Now how to make the user download the image automatically ? not showing the image but instead making him to "download" the file. Thanks for advising me about this. Bob
If they can display the image, they've already downloaded it and can save it.
However, you can't "make" him download the image - that's up to the browser settings. All you can do is recommend downloading the picture;
To do that, your script needs to check the time limit, and if it's within the appropriate headers, i.e.
header('Content-disposition: attachment; filename=image.gif'); header('Content-type: image/gif'); readfile('image.gif');
-- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstuck...@attglobal.net ==================- Hide quoted text -
- Show quoted text -
Jerry
I just noticed the part about the header, this may resolve an issue I
have been having streaming images out. I want to set the mime type in
the header and also send the size so Flash knows how big it is, but it
would never let me do more than one "content" in the header tag. I
tried seperating them with "\n" like I would do in perl, but now,
after seeing what you posted, it dawned on me that you can use
multiple header()'s instead of combining them into one. Is that so?
Bill H
That is correct.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
Bob Bedford wrote:
>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 :-)
703designs wrote:
Hi Bob,
I think that you'll find this comment helpful: It looks like a pretty
bulletproof way to force a file download, just tweak it to work with
these images rather than .xls files.
http://us2.php.net/manual/en/function.header.php#83384
Thomas
On Sep 23, 1:24 pm, "Bob Bedford" <b...@bedford.comwrote:
>>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
Well I never! Had no idea that was possible... you learn something new
every day on usenet! :-) Bob, please disregard my previous message!
Has anyone tried this yet? Does it work well? For example: does it
trigger Internet Explorer's annoying download auto blocker functionality?
Cool :-)
Roger. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Martin |
last post by:
I have a situation where I'm displaying some information in a table on
a web page. I've given the user the ability to make several different
"queries" and show different sub-sets of the data.
I...
|
by: Sebastian C. |
last post by:
Hello everyone
I just found at the adress below Microsoft Access Run Time. It says
that this is Access Run Time :Alternative Version.
There is nothing about who can download or install this...
|
by: Ted Miller |
last post by:
Hi folks,
I'm looking at moving a large base of C++ code to .Net under tight time
constraints. The code runs in mission-critical environments, and I am
extremely concerned about the loader lock...
|
by: Asaf |
last post by:
Hi,
Is there a way to create a temporary download link and to know when the
client has finished downloading the file?
Thanks in advanced,
|
by: mesut demir |
last post by:
Hi All,
When I create fields (in files) I need assign a data type like char,
varchar, money etc.
I have some questions about the data types when you create fields in a
file.
What is the...
|
by: windandwaves |
last post by:
Hi Folk
Some of my clients asked me to create "fancy emails" for them (aka html
formatted emails).
I know how to make a nice html document, but I had trouble creating a simple
way to provide...
|
by: nephish |
last post by:
Hello there,
i have an app that i need to be able to publish a link to download a
csv file.
i know that i can use php to make the file, but how to i link to it
through php.
like if i have an...
|
by: moondaddy |
last post by:
I want to create a custom UI element which will be a custom rectangle object
in a c# XAML application. I'm new to XAML and c# as most of my experience
has been using vb with sql. I'm building a...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: Ricardo de Mila |
last post by:
Dear people, good afternoon...
I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control.
Than I need to discover what...
|
by: ezappsrUS |
last post by:
Hi,
I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
|
by: jack2019x |
last post by:
hello, Is there code or static lib for hook swapchain present?
I wanna hook dxgi swapchain present for dx11 and dx9.
| |