PHP and Javascript

I

Ismael

Hello all,

I know this more a javascript rather than a php problem,
but i searched internet and couldn't find an answer.

Here it is : I simply want to know how to open a "Open File"
or "Save File" box, after clicking an html button.

I'm sure it's a three-lines-of-code problem :)
Which class implements this ?

Thank you very much

Ismael
 
H

Hywel

Hello all,

I know this more a javascript rather than a php problem,
but i searched internet and couldn't find an answer.

Here it is : I simply want to know how to open a "Open File"
or "Save File" box, after clicking an html button.

I'm sure it's a three-lines-of-code problem :)
Which class implements this ?

<input type="file">
 
B

brotherli

Ismael said:
Hello all,

I know this more a javascript rather than a php problem,
but i searched internet and couldn't find an answer.

Here it is : I simply want to know how to open a "Open File"
or "Save File" box, after clicking an html button.

I'm sure it's a three-lines-of-code problem :)
Which class implements this ?

To upload a file (get the "Open file" dialog) you place a form on your
page with an <input type="file">.

To force the browser to show a "Save file" dialog rather than
displaying/opening the requested file you have to send an according
mime-type within the HTTP header. This you can do with PHP:

header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="myfile.txt"');


Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top