SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    _ silver trophy ses5909's Avatar
    Join Date
    Jul 2003
    Location
    NoVa
    Posts
    5,466
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    open a save as box

    I have a list of word documents that are stored in the database. I present a tabular view of certain info re: the word documents as well as a doc image where if they click on it I would like it to open a save as box to allow the user to save the file to their computer rather than displaying the word doc in a browser window.

    Thank you,

    Sara

  2. #2
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm guessing, but I would imagine that this is something that's down to the user's individual browser settings i.e. a link to an executable file will ask the user if they want to download or run the file, however a non-executable file such as a Word document is probably considered harmless enough to simply open.


    Andy
    From the English nation to a US location.

  3. #3
    SitePoint Addict Scud's Avatar
    Join Date
    Jan 2002
    Location
    Los Angeles
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, Andy is correct, this is all up to the settings of the individuals browser, the only way I can think of getting around this is to put the files into a .zip file.

  4. #4
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can make it popup a download box by setting the Content-Disposition header in the actual file being downloaded.

    Example, if you are serving the files via a PHP script:
    PHP Code:
    header('Content-Disposition: attachment; filename=somedoc.doc'); 
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  5. #5
    _ silver trophy ses5909's Avatar
    Join Date
    Jul 2003
    Location
    NoVa
    Posts
    5,466
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Thanks Jeff. can I repeat that for several documents because they are not hardcoded into the file, they are pulled from the db.

  6. #6
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pulling them from the Database makes it quite a bit easier. All you need to do is output that header (with whatever filename you like) before serving the content.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.


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
  •