Click to See Complete Forum and Search --> : File save window


bkhe
12-21-2003, 08:15 PM
I have a html page listing of the files and I want to load a file save window that allows user to select the directory where the user can save the file. How can I load this file save window to select the directory.

There a html input type file that loads the file open window but there is no directory selection window.

AdamBrill
12-21-2003, 09:07 PM
I'm not exact sure what you mean, but if you want to popup a box that allows the user to browse through and select a directory like they would normally select a file, I don't think it's possible. JS has limited capabilities.

olerag
12-21-2003, 09:35 PM
If your refering to providing a dialog box to save a file
to the file system instead of actually displaying an HTMl file
(such as downloading an XML file), you'll need to have your
DHTML (on the server-side) issue the file as type
"octet-stream"; i.e.,
Content-Type: application/octet-stream

AdamBrill
12-21-2003, 09:41 PM
Originally posted by olerag
If your refering to providing a dialog box to save a file
to the file system instead of actually displaying an HTMl file
(such as downloading an XML file), you'll need to have your
DHTML (on the server-side) issue the file as type
"octet-stream"; i.e.,
Content-Type: application/octet-stream You cannot use "DHTML" server-side. You will have to use a server-side language to do that...

olerag
12-22-2003, 07:47 AM
Adam - maybe you can unconfuse me....

I was under the impression that server-side DHTML was
generated via a server-side language, such as a Java
servlet.

Consequently, if a servlet generated an HTML file and the
Content-Type was specified as "octet-stream", the File-Save
Download dialog would appear instead of generating the
HTML source in a browser window.

AdamBrill
12-22-2003, 08:23 AM
Originally posted by olerag
Consequently, if a servlet generated an HTML file and the
Content-Type was specified as "octet-stream", the File-Save
Download dialog would appear instead of generating the
HTML source in a browser window. You are correct, but what I was pointing out is that you cannot do that with DHTML. You need a server-side language(like you said) and DHTML is not a server-side language.

olerag
12-22-2003, 08:32 AM
I guess this is where I'm confused. I was under the
impression that DHTML was simply the act of producing
dynamic HTML and "not a separate HTML language"??

AdamBrill
12-22-2003, 10:32 AM
DHTML is the use of HTML with JavaScript, and since JavaScript is a client side language not server-side, you will need something else. ;) You can generate DHTML with a server-side language, but you can also generate HTML/XHTML with a server-side language, so it doesn't matter what you are using. For something like this, though, you won't actually be using much of (X)HTML or DHTML; it will be mostly just whatever server-side language that they choose. If your interested in seeing a PHP force download script, Pyro has created one here. (http://www.infinitypages.com/research/download.htm)

olerag
12-22-2003, 12:12 PM
OK - got you. I'll need to watch what I type in the future.

I've seen the example you linked that "pyro" created and,
indeed, it is located in the "DHTML" forum.

Now here's my really stupid question. If DHTML is simply
HTML combined with Javascript, why not simply combine the
two forum sections into this, the Javascript, forum?? Afterall,
what is the purpose of JS other that to support HTML?

AdamBrill
12-22-2003, 01:45 PM
Originally posted by olerag
I've seen the example you linked that "pyro" created and,
indeed, it is located in the "DHTML" forum.Huh? The link that I posted to is located on Pyro's server, not on any "forums". If you mean that someone posted to it from the DHTML forums, that certainly doesn't make it DHTML. One way or the other, that example is PHP; it has nothing to do with DHTML.

Originally posted by olerag
Now here's my really stupid question. If DHTML is simply
HTML combined with Javascript, why not simply combine the
two forum sections into this, the Javascript, forum?? Afterall,
what is the purpose of JS other that to support HTML?Well, they really could be combined, but the forums administrators thought it was better to seperate them. :) Most of the time DOM questions, etc, would get asked in the DHTML section... ;)