Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   how to save picture not displayed ? (http://www.velocityreviews.com/forums/t160326-how-to-save-picture-not-displayed.html)

Tuckbros 12-17-2004 04:54 PM

how to save picture not displayed ?
 
Hi everybody,
I am doing a small site with picture to save. My problem is to offer
pictures to download, not to display. Can someone tell me how can I make
the "save as" dialog to open, without using the right clic and "save
target as".
Thanks in advance

Fat Sam 12-17-2004 05:11 PM

Re: how to save picture not displayed ?
 
Tuckbros wrote:
> Hi everybody,
> I am doing a small site with picture to save. My problem is to offer
> pictures to download, not to display. Can someone tell me how can I
> make the "save as" dialog to open, without using the right clic and
> "save target as".
> Thanks in advance


Wrap up the images in a zip file?



Steve Pugh 12-17-2004 05:27 PM

Re: how to save picture not displayed ?
 
On Fri, 17 Dec 2004 17:54:05 +0100, Tuckbros <tuckbros@free.fr> wrote:

>I am doing a small site with picture to save. My problem is to offer
>pictures to download, not to display. Can someone tell me how can I make
>the "save as" dialog to open, without using the right clic and "save
>target as".


You could lie about the mime type.

You could put the image in a zip file.

You could offer the image in a format that browsers don't usually
display (TIFF for example).

You could do nothing and let users see the image before deciding
whether they want to save it or not.

Steve


Richard 12-17-2004 06:23 PM

Re: how to save picture not displayed ?
 
Steve Pugh wrote:

> On Fri, 17 Dec 2004 17:54:05 +0100, Tuckbros <tuckbros@free.fr> wrote:


>>I am doing a small site with picture to save. My problem is to offer
>>pictures to download, not to display. Can someone tell me how can I make
>>the "save as" dialog to open, without using the right clic and "save
>>target as".


> You could lie about the mime type.


> You could put the image in a zip file.


> You could offer the image in a format that browsers don't usually
> display (TIFF for example).


> You could do nothing and let users see the image before deciding
> whether they want to save it or not.


> Steve


But he wants to do it without right clicking any thing.
I don't think it's possible.



Tuckbros 12-17-2004 06:49 PM

Re: how to save picture not displayed ?
 
Tuckbros wrote:
> Hi everybody,
> I am doing a small site with picture to save. My problem is to offer
> pictures to download, not to display. Can someone tell me how can I make
> the "save as" dialog to open, without using the right clic and "save
> target as".
> Thanks in advance


The images I plan to save are generated with a php script. An image with
poor quality but light is sent to the brother while a better is
generated as a jpg file and stored on the server. I made a link from the
light picture to the heavier, but it displays the image. And I would
like to save it instead of displaying.
I looked if I can compress it in a file but it will load the server for
quite nothing.

Fat Sam 12-17-2004 06:54 PM

Re: how to save picture not displayed ?
 
Tuckbros wrote:
> Tuckbros wrote:
>> Hi everybody,
>> I am doing a small site with picture to save. My problem is to offer
>> pictures to download, not to display. Can someone tell me how can I
>> make the "save as" dialog to open, without using the right clic and
>> "save target as".
>> Thanks in advance

>
> The images I plan to save are generated with a php script. An image
> with poor quality but light is sent to the brother while a better is
> generated as a jpg file and stored on the server. I made a link from
> the light picture to the heavier, but it displays the image. And I
> would like to save it instead of displaying.
> I looked if I can compress it in a file but it will load the server
> for quite nothing.


Can you post a link please?

--
Sam.
www.fixaphoto.co.uk




Tuckbros 12-17-2004 07:18 PM

Re: how to save picture not displayed ?
 
Fat Sam wrote:
> Tuckbros wrote:
>
>>Tuckbros wrote:
>>
>>>Hi everybody,
>>>I am doing a small site with picture to save. My problem is to offer
>>>pictures to download, not to display. Can someone tell me how can I
>>>make the "save as" dialog to open, without using the right clic and
>>>"save target as".
>>>Thanks in advance

>>
>>The images I plan to save are generated with a php script. An image
>> with poor quality but light is sent to the brother while a better is
>>generated as a jpg file and stored on the server. I made a link from
>>the light picture to the heavier, but it displays the image. And I
>>would like to save it instead of displaying.
>>I looked if I can compress it in a file but it will load the server
>>for quite nothing.

>
>
> Can you post a link please?
>

a link to what ?

Fat Sam 12-17-2004 07:25 PM

Re: how to save picture not displayed ?
 
Tuckbros wrote:
> Fat Sam wrote:
>> Tuckbros wrote:
>>
>>> Tuckbros wrote:
>>>
>>>> Hi everybody,
>>>> I am doing a small site with picture to save. My problem is to
>>>> offer pictures to download, not to display. Can someone tell me
>>>> how can I make the "save as" dialog to open, without using the
>>>> right clic and "save target as".
>>>> Thanks in advance
>>>
>>> The images I plan to save are generated with a php script. An image
>>> with poor quality but light is sent to the brother while a better
>>> is generated as a jpg file and stored on the server. I made a link
>>> from the light picture to the heavier, but it displays the image.
>>> And I would like to save it instead of displaying.
>>> I looked if I can compress it in a file but it will load the server
>>> for quite nothing.

>>
>>
>> Can you post a link please?
>>

> a link to what ?


A link to the pages you have in place at the moment.....I'm not entirely
clear what you mean by "poor quality but light" and also when you talk about
sending an image to your brother......I thought if I could see the page it
would make it easier to understand, and therefore find a solution......

--
Sam.
www.fixaphoto.co.uk
high quality photographic
restorations and repairs



Karl Core 12-17-2004 07:26 PM

Re: how to save picture not displayed ?
 

"Tuckbros" <tuckbros@free.fr> wrote in message
news:41c32a1d$0$22340$8fcfb975@news.wanadoo.fr...
> Tuckbros wrote:
>> Hi everybody,
>> I am doing a small site with picture to save. My problem is to offer
>> pictures to download, not to display. Can someone tell me how can I make
>> the "save as" dialog to open, without using the right clic and "save
>> target as".
>> Thanks in advance

>
> The images I plan to save are generated with a php script. An image with
> poor quality but light is sent to the brother while a better is generated
> as a jpg file and stored on the server. I made a link from the light
> picture to the heavier, but it displays the image. And I would like to
> save it instead of displaying.
> I looked if I can compress it in a file but it will load the server for
> quite nothing.


Create a new PHP file and call it something like "downloadimage.php"

Access it like so:
http://www.example.com/downloadimage.php?img=foo.jpg

Where 'foo.jpg' is the name of the image you want them to download

<?php

/* image name */
$image_name=$_REQUEST['img'];

/* content type here. you could do some sexy stuff to detect it, or you
could hard-code it if you know that all of them are the same */
header("Content-Type: image/jpeg");

/* attachment disposition causes it to be treated like a download */
header("Content-Disposition: attachment; filename=$image_name");
readfile("../images/$image_name");
?>


--
-Karl Core
Please Support "Project Boneyard":
http://www.insurgence.net/info.aspx?...&item=boneyard



Tuckbros 12-17-2004 10:07 PM

Re: how to save picture not displayed ?
 
Dear Karl Core,
you are a master, thanks a lot.

instead of linking to the picture I linked to the php file containing
the following code :

$image_name = "../../sessions/" . session_id() . "/Avatar.jpg" ;
$save_name = "Avatar.jpg";
/* attachment disposition causes it to be treated like a download */
header("Content-Disposition: attachment; filename=$save_name");
readfile("$image_name");

where $save_name is the default name og the downloaded file and
$image_name is the name of the image to saved.

Karl Core wrote:
> "Tuckbros" <tuckbros@free.fr> wrote in message
> news:41c32a1d$0$22340$8fcfb975@news.wanadoo.fr...
>
>>Tuckbros wrote:
>>
>>>Hi everybody,
>>>I am doing a small site with picture to save. My problem is to offer
>>>pictures to download, not to display. Can someone tell me how can I make
>>>the "save as" dialog to open, without using the right clic and "save
>>>target as".
>>>Thanks in advance

>>
>>The images I plan to save are generated with a php script. An image with
>>poor quality but light is sent to the brother while a better is generated
>>as a jpg file and stored on the server. I made a link from the light
>>picture to the heavier, but it displays the image. And I would like to
>>save it instead of displaying.
>>I looked if I can compress it in a file but it will load the server for
>>quite nothing.

>
>
> Create a new PHP file and call it something like "downloadimage.php"
>
> Access it like so:
> http://www.example.com/downloadimage.php?img=foo.jpg
>
> Where 'foo.jpg' is the name of the image you want them to download
>
> <?php
>
> /* image name */
> $image_name=$_REQUEST['img'];
>
> /* content type here. you could do some sexy stuff to detect it, or you
> could hard-code it if you know that all of them are the same */
> header("Content-Type: image/jpeg");
>
> /* attachment disposition causes it to be treated like a download */
> header("Content-Disposition: attachment; filename=$image_name");
> readfile("../images/$image_name");
> ?>
>
>



All times are GMT. The time now is 12:34 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.