// Declare your shortcode
add_shortcode("download", "downloadFunction");
// Second Declare your shortcode function
function downloadFunction($att, $content, $code){
// your function is passed 3 Arguments
// $atts : this is an array of the shortcode's attributes
// $content : this is the content between the code. in your case the file url.
// $code : this is the code used. in this case it will be download.
// here we only need the $content of the shortcode which we place for the file
$return = '<a class="download" href="'.$content.'">download file</a>';
$return .= '<a class="download" href="http://docs.google.com/viewer?embedded=true&url=".$content."">preview file</a>';
// we then return the result.
return $return;
}