View Full Version : Writing/Downloading Element Content
09-24-2011, 06:38 PM
Thanks in advance,
09-24-2011, 07:18 PM
Much better to do this with server-side coding (PHP/ASP/JSP/etc.).
That way you can have the server-side script *tell* the browser to download the file, rather than just display it.
I think the best you could do with JS would be to copy the text to the clipboard (and now we are talking browser dependencies) so that you can then just paste it into a text file.
This *COULD* be done with MSIE, assuming that the browser user is willing to give special (dangerous!) permissions to the web site in question. Normally, you would only do this in an inTRAnet situation, not inTERnet.
09-24-2011, 07:46 PM
09-24-2011, 09:06 PM
Could you use AJAX to send the contents of the div to the php script maybe? (this would be in key/pair format, or XML of course)
09-25-2011, 02:23 AM
Don't think you need or want AJAX, actually.
You just want to send the <div> contents to PHP and then have PHP respond with a "download this file", where there's not really any file, just the <div> contents returned.
I'm not enough of a PHP person to know the right stuff to respond with. I could show you how it would work with ASP, but then you'd have to translate it.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.