Need help saving a jpg via flash but not via browser

hello,

trying to work out whether there’s a way to save a pic from within a flash photo gallery i’m working on. i’m trying to create an effect that is similar to right clicking in a browser on a pic and then selecting “Save Picture As…”.

anyone got any ideas?

thanx

I dont think thats possible unless you zip the jpg and use the getURL action.

that’s what i was thinking, though i have an array of pics. sure wish there was a way without using getURL.

i’m wondering if i could have a module in php compress the required jpg on the fly and then have getURL link to the zip instead?

Here you go :wink:

eyezberg

just what i needed :slight_smile:

didn’t think about passing the jpg url’s as variables via js

nice one, this has helped a lot!

this forums fast :slight_smile: back soon! i must return the favour

just discovered a serverside way of doing this with raw http headers by using the header() php function. the following as calls the rename.php file that follows the as below:

save_btn.onRelease = function() {
	pass_pic_path = history_sequence_array[index_selection];
	getURL("rename.php?file=" + pass_pic_path);
	tip("");
};
<?
$file = $_GET['file'];
header("Content-Type: image/jpeg");
header ("Content-disposition: attachment; filename=".$file.";");
header("Content-Length: ".filesize($file));
readfile($file);
exit;
?>

this works a treat. now to use this process with a right click context menu, any ideas?

this flash beats java any day? :slight_smile: why didn’t i get into flash sooner

been searching through some of the posts here today, top place!