WebCommon::setKayaUploadDir(3) Set a temporary directory for Kaya file uploads.


Void setKayaUploadDir( String newdir )


newdir The temporary directory.


User file uploads are placed in a temporary directory. The default directory is the current directory for the CGI program or webapp, which is strongly 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.

Firstly, calling this function from within the CGI or webapp's webconfig 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!)

Secondly, if this function has not been used, the HTTP_KAYA_UPLOAD_DIR 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.

 webapp example;
 import Webapp;
 import HTMLDocument;
 Void webconfig() {
 HTMLDocument webmain() {
     // program goes here!

Note that Kaya (from 0.2.4 onwards) will not accept file uploads at all unless 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


Kaya standard library by Edwin Brady, Chris Morris and others ([email protected]). For further information see http://kayalang.org/


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.