i've got files stored in a mysql database and want offer them for download. how can i let them be downloaded without creating the file on the server? i thought about fsockopen().
If you're talking about writing the file to your client's system, fsockopen() won't do it. fsockopen() requires that something be listening on a port and IP address.
I recommend that you fetch the data from the database and stream it to the client after setting the appropriate headers for content-type and content-disposition. See the examples on the online manual page under header() for more information:
thanks, that works perfect, but the popup should close after the download. how do i do that? i've seen something with javascript "on_load(close)" or similar but i couldn't get it to work
well to stream the download i have to open a popup and declair the headers. afterwards the stystem-window comes and prompts where to save the download. after the download the popup is still there. is there a way to do this without popup?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.