When you browse a web site, the "favicon" icon shows up next to the URL (or the bookmark).

If I want that graphic, is there a way to download it directly from the site? I'd prefer to download it directly from the web, but if all else fails, I'll dig it out of wherever it is stored on my computer (Windows 7, Firefox 3.6.6).

link|improve this question

feedback

4 Answers

up vote 11 down vote accepted

Studiohack has the "thorough" approach but heres a short hack:

  1. Enter the domain name like http://superuser.com/
  2. Add favicon.ico to the end
  3. Press enter (this should be in url: http://superuser.com/favicon.ico
  4. Right click on image and save as
link|improve this answer
The other answers are all awesome. I learned a lot, thank you. But, for my specific purposes, this is what I was looking for. Accepted. – Robert Cartaino Jun 30 '10 at 2:44
Well, except for sites like Wikia. – Hello71 Jul 4 '10 at 22:14
feedback

by reading http://en.wikipedia.org/wiki/Favicon you can also find that:

The following format is cross-browser compatible and is supported 
by Internet Explorer, Firefox, Chrome, and Opera.[3]

<link rel="shortcut icon" href="http://www.example.com/myicon.ico" />

Additionally the following is also acceptable:

<link rel="shortcut icon" href="/somepath/myicon.ico" />

The following shows the supported format of link tags, using examples, 
for HTML and XHTML.

HTML:
<link rel="icon" type="image/vnd.microsoft.icon" 
      href="http://example.com/image.ico">
<link rel="icon" type="image/png" href="http://example.com/image.png">
<link rel="icon" type="image/gif" href="http://example.com/image.gif">

so, the common practice is indeed to put a file called 'favicon.ico' on the root folder, but to be sure, you have to lookup the source code of the served file and see if and what is defined there.

eg, for http://superuser.com it is

<link rel="shortcut icon" href="http://sstatic.net/su/favicon.ico"> 
link|improve this answer
1  
+1 for being complete – David Zaslavsky Jun 29 '10 at 4:16
feedback

In Firefox 3: Click the favicon, a popup appears, and you can click "more information"...in the window that pops up, go to the "Media" tab. Highlight the specific media item that you want (it shows a preview in the large, white space in the bottom of the window), then click "Save As". Give it a name, pick a location, and you're done! :)

Some sites may not have a favicon listed, but some will...hit or miss...try this on Super User...SU has a favicon listed...

link|improve this answer
feedback

Try this bit of PHP which grabs the favicon and saves it as an .ico file. You could probably use this to grab almost any file. Note the use of the 'b' for 'binary' flag.

<?php
    echo '<p>Fetching Favicon.ico.</p>';
    $in = fopen('http://targetdomain.com/favicon.ico', 'rb');
    $contents = '';
    while (!feof($in)) {
        $contents .= fread($in, 8192);
        }
    fclose($in);
    $len = strlen($contents);
    echo '<p>Read ' . $len . ' bytes.</p>';

    $out = fopen('favicon.ico', 'wb');
    fwrite($out, $contents, $len);
    fclose($out);
    echo '<p>Written Favicon.ico.</p>';
?>
link|improve this answer
Oh crap. It stripped all the code formatting and the braces. Sorry about that. I've gone back and found out how to do code blocks. – PHP Hacker Dec 13 '11 at 14:50
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.