If you create a hyperlink to a media file that can be opened within the browser such as an mp3, mpg, jpg, pdf, etc. a single left click will open the file in the web browser instead of triggering a download. To download the file you need to right click (CTRL + click for mac) and choose 'Save File As...' from the dropdown.
If your intention is to create a link for the user to download the file rather than viewing it in their browser you can do so using a simple php script. Create a file called 'download.php' and copy in the following php:
<?php
$download_file = $_GET['file'];
$download_file_name = $_GET['name'];
$handle = fopen($download_file, "r");
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$download_file_name);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($download_file));
ob_clean();
flush();
readfile($download_file);
fclose($handle);
exit;
?>
You can then create your download links like so:
www.example.com/download.php?file=images/example.jpg&name=hello.jpg
The URL should include the path to the file to be downloaded, and the name you want to give the file. In the above example the file is 'images/example.jpg' but the name of the file downloaded by the user would be 'hello.jpg'
When using PHP headers it is important to note that the headers will only be executed if they are called before any text is output to the page. Any html, or php echo tags, before the headers will cause the headers to be ignored. A line break or space before the opening php tag will also prevent headers from working.
Please how do I just rotate a simple circle in flash on mouse over and stop on mouse away.
Hi Lynette
I don’t see how this question relates to this article, but:
1. Draw a circle
2. Convert your circle to a button
3. Create a keyframe on the over state of the button
4.select the circle in the over keyframe and covert it to a movie clip.
5. edit the movie clip to include a motion tween
6. on the first frame of the motion tween edit the frames properties - setting rotation to either clock-wise or counter clock-wise