Ns returnfile

From AOLserver Wiki
Revision as of 13:20, 19 August 2008 by Tigre (talk | contribs)
Jump to navigation Jump to search
ns_returnfile 200 "application/zip" $filepath
ns_returnfile 200 [ns_guesstype $file] $filepath

Caveat programmor

ns_returnfile uses fastpath internally, so care should be taken when using it to return dynamically generated files. A better practice if dealing with dynamic data in the filesystem would probably be to use ns_returnfd instead.

Also, see ns_return

Want to name the file returned?

ns_set update [ns_conn outputheaders] content-disposition "attachment; filename=1.abc"