Results 1 to 3 of 3

Thread: [RESOLVED] Open/Save Dialog Box

  1. #1

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Resolved [RESOLVED] Open/Save Dialog Box

    I currently use the below to open a selected file but instead of the file opening in the browser (which it now does) I want to display the default browser open/save dialog box. I presume I may have to add additional headers?

    PHP Code:
    header("Location: $openfile"); 

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Open/Save Dialog Box

    instead of Location, try:

    PHP Code:
    header('Content-disposition: attachment');
    header('Content-type: mime/type');
    header('Content-length: '.filesize($openfile));
    readfile($openfile); 
    Replace mime/type with the correct MIME type of the file.

  3. #3

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Resolved Re: Open/Save Dialog Box

    Thanks pengate, got it working

Posting Permissions

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



Click Here to Expand Forum to Full Width