Ive got imagecache set up, alongside filedfield.
I'm using filefield to add an image to my page, and php to show the image inside a sidebar block.
So far so good, that works.

Now, id like to be able to create a link to the original image (since that function doesn't work on imagecache)
I've been fiddling wit this piece of code to display the image loaded inside the node in my block. And i almost gotten so far as to link it to the original, but the node is loaded not in the side root but in a /folder/node way. So the link to my image turned out to look like this: siteroot/folder/sites/all/images/image.jpg thus not linking to an existing location.

I'm sure this is fairly easy, but i can't handle this on my own im afraid...

<?php  
if(arg(0)=='node' && is_numeric(arg(1)) && (arg(2)!='edit') && (arg(2)!='delete')) { 
  if ($node = node_load(arg(1))) { if ($node->type == "workshop") { 
   if ($node->field_workshop_flyer) {
       print theme('imagecache', 'Workshop_Flyer', $node->field_workshop_flyer[0]['filepath'], $node->field_workshop_flyer[0]['description'],  $node->field_workshop_flyer[0]['description']);
      }
    }
  }
}
?>
<?php 
 print '</a>'
?>

I don't know how to sanitize (Which should be not too big an issue) and be able to link to the original.