i want to view file that i have attached through my program

just visualise ..we attach file to our mail
gmail/yahoo
after attaching that i want to view the file..(read only)only contents

so pls help on this wht shud b code for "view"ing that file

thanks in advance
urs sinc.
ash