SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2008
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CV Display problems...!

    Dear friends,

    A very good all, We were able to build a small basic jobsite for our own firm but we failed to display a good formatted CV/resume in the browser as monster jobs or any other jobportal provides.

    How could we display/view a word, PDF, txt file stored in the datebase when employer clicks on view resume.

    You suggestion and comments of the above will be highly appreciated.

    Regards

  2. #2
    SitePoint Addict Trent Reimer's Avatar
    Join Date
    Sep 2005
    Location
    Canada
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can store the document as a binary large object (BLOB). Then when you output the document you would preface it with a "header()" call containing the content-type.

    PHP Code:
    // generic Content-type header
    header('Content-type: application/octet-stream'); 

  3. #3
    SitePoint Zealot cholmon's Avatar
    Join Date
    Mar 2004
    Location
    SC
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also store the files in a non-web-accessible directory on your server, then use readfile() to send it out with the same content type that Trent mentioned:

    PHP Code:
    <?php

        $file 
    '/path/to/file/a98d76cb0cce.doc';
        
    $name 'resume.doc';

        
    header('Content-type: application/octet-stream');
        
    header('Content-Disposition: filename='.$name);

        
    readfile($file);

    ?>
    Drew C King: PHP Developer
    <?= $short_tags++ ?>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •