Exporting a file created on the fly using Drupal and PHP -


i using drupal 6, , create content can exported. specifically, able generate random content string, , able export viewer text file. pop usual dialog box browser downloading content (etc.). don't need save file on server, because content changing, , prefer solution avoid that.

i mildly proficient programmer, not expert on of drupal's functions. simpler answer, better.

thanks

i found out solution question. if use php header() able accomplish this.

here snippet of code used it.

header("content-type: text/plain"); //the content type exporting header("content-disposition: attachment; filename=myfilename.txt"); header("pragma: no-cache"); //i don't want cached because changing echo "my file contents"; exit(0); 

there many things remember when doing this, of documented in link.

hopefully useful else


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -