.\" This man page is automatically generated using .\" kayadoc2man from the Kaya development tools and the -xmldocs compile .\" option. Editing it directly is not encouraged. .\" It is under the same license as the source .k file that it was .\" generated from. .TH "WebCommon.setKayaUploadDir" "3kaya" "August 2014" "Kaya" "Kaya module reference" .SH "NAME" WebCommon::setKayaUploadDir \- Set a temporary directory for Kaya file uploads. .SH "SYNOPSIS" .B Void setKayaUploadDir( \fIString newdir\fP .B ")" .SH "ARGUMENTS" .PP .B "newdir" The temporary directory. .SH "DESCRIPTION" .PP User file uploads are placed in a temporary directory. The default directory is the current directory for the CGI program or webapp, which is \fBstrongly\fP discouraged for production use. There are two ways to set the new temporary directory, which should ideally be an otherwise empty directory outside the public website, only readable and writeable by the user the program runs as. .PP Firstly, calling this function from within the CGI or webapp's \fBwebconfig \fP function will set the directory. (Calls from any other location have no effect, because the uploaded files have already been saved to the temporary location by then!) .PP Secondly, if this function has \fBnot\fP been used, the \fBHTTP_KAYA_UPLOAD_DIR \fP environment variable (consult your webserver documentation for setting environment variables), will be read and used. This feature should not be used by application developers, who should use this function and provide an installer-configurable way to set the directory - it is intended to provide a means for Kaya application users to deal with applications which do not use this function. .IP "" -4 webapp example; import Webapp; import HTMLDocument; Void webconfig() { allowFileUploads(); setKayaUploadDir("/users/kaya/tmp"); } HTMLDocument webmain() { // program goes here! } .PP Note that Kaya (from 0.2.4 onwards) will not accept file uploads at all unless .B "WebCommon.allowFileUploads"(3kaya) is called first, so you don't need to use this function in applications that do not require file uploads unless your Kaya version is 0.2.2 or 0.2.3 .SH "AUTHORS" Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/ .SH LICENSE The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (version 2.1 or any later version) as published by the Free Software Foundation. .SH "RELATED" .PD 0 .PP .B "WebCommon.allowFileUploads"(3kaya) .PP .B "WebCommon.setKayaMaxPost"(3kaya) .PD 0.4v