Note that there are some explanatory texts on larger screens.

plurals
  1. POForce download from string
    primarykey
    data
    text
    <p><strong>SOLVED:</strong> Look at <a href="https://stackoverflow.com/posts/comments/16107323">this</a> comment!</p> <p>I have this php page echoing some xml data, which the user should save. I want the page to automatically open the "Save as" window, since the page downloading the data is called "download.<strong>php</strong>" this won't start a "Save as" by it self. I read a lot of other threads here on stackoverflow by people asking the same question. None of those solves my problem. So yes, I am creating a duplicate by purpose.</p> <p>This is my code:</p> <pre><code>$file.='&lt;bpage&gt;'; $file.='&lt;title&gt;'.$_POST["title"].'&lt;/title&gt;'; $file.='&lt;desc&gt;'.$_POST["desc"].'&lt;/desc&gt;'; $file.='&lt;cont&gt;'.$_POST["cont"].'&lt;/cont&gt;'; $file.='&lt;img&gt;'.$_POST["img"].'&lt;/img&gt;'; $file.='&lt;tdata&gt;'.$_POST["tdata"].'&lt;/tdata&gt;'; $file.='&lt;link&gt;'.$_POST["link"].'&lt;/link&gt;'; $file.='&lt;writer&gt;'.$_POST["writer"].'&lt;/writer&gt;'; $file.='&lt;date&gt;'.$_POST["date"].'&lt;/date&gt;'; $file.='&lt;/bpage&gt;'; header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=".$_POST["title"].'.bpage'); echo $file; </code></pre> <p>I am not having any "Save as" dialog, simply the usual page, as if it ignored all my headers. I am using Chrome and the latest version of PHP.</p> <p>--<br/> Regards Locercus</p> <p>Edit: I am using One.com for hosting. Could they possibly be blocking the header function?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload