Page 1 of 1

header file help need code

Posted: Fri Dec 09, 2011 10:10 pm
by kshitizgp
:offtopic: hey guyz when i run this code it directly download the file ..i want the option of save as to pop up ..cananyboy help and also i have file c folder ("protocol text") but the php in not rendering the that ....how can i do that?

sry am newbie in php ! :banghead:


header("Content-Type: plain/text");
header("Content-Disposition: Attachment; filename=c:\protocol.txt");
// header("Pragma: no-cache");

echo "text text ";

exit ;

Re: header file help need code

Posted: Sat Dec 10, 2011 2:14 am
by social_experiment
I'm guessing you would have to use javascript for this

Re: header file help need code

Posted: Sat Dec 10, 2011 2:56 am
by kshitizgp
@social_experiment


but when i use this code for PDF its show the save as option :mrgreen:
<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');

// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');

// The PDF source is in original.pdf
readfile('original.pdf');
?

:mrgreen:

v aint using any javascripts for this :O :O :crazy: :cry: 8O 8O 8O 8O 8O 8O

Re: header file help need code

Posted: Sun Dec 11, 2011 1:52 am
by social_experiment
<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span> wrote:v aint using any javascripts for this
Yeah i didn't mean "use javascript to download the file" i meant "use javascript to create the pop-up" but i see you already getting some type of pop-up with your existing php code; Good luck with it btw.

Re: header file help need code

Posted: Mon Dec 12, 2011 4:43 am
by kshitizgp
Yeah i didn't mean "use javascript to download the file" i meant "use javascript to create the pop-up" but i see you already getting some type of pop-up with your existing php code; Good luck with it btw.



Thnx :P ..it happened without javascripts :P
@social experiment :drunk: