May 2016. wsurvey_readFiles.js documentation. These functions simplify file uploads using They are designed to make the contents of a file upload accessible to javascript functions. In particular, suppose you wish to use ajax to transfer information to a php script; rather than using a
. In such a case, you will need to explicitily access the contents of a file upload. These functions make that easy. They can also be used if you are going to use a (with a button -- while not as necessary, these functions do support some nice display options. ----------------- Function list uploadInfo=ws_readFiles_setup(useid,options) -- initial setup. ws_readFiles_clear(uploadInfo) -- reset & clear file upload elements ws_readFiles(evt) -- event manager assigned to element. ws_readFiles_unpack(storeName) -- unpack information stored by ws_readFiles ----------------- Descriptions of functions: uploadInfo=ws_readFiles_setup(useid,options) -- initial setup. Arguments: useid: either '', 1, or the id of an element If '1' or '', then a default value ('readFiles') is used. An element with this id MUST EXIST. It should be a element. If no such element exists, an error (with an alert message) occurs. options: optional. If specified, an associative array that can have the following fields: maxFiles = maximum # of files that will be uploaded (default is 25) maxFileSize = maximum file size, in mega bytes (default is 10) infoId = id of container to display file information (size, etc) If 0, do NOT display file information If 1 or '' or not specified, use useid+'_info'. If the '1' or '' is specified, and a useid+'_info' element doesn't exist, it will be created and appended after the useid container. If infoid is specified, and it doesn't exist, an error occurs. Note: it is recommended that you specify an infoid a container in your html (so you can nicely place it) storeName = name (not id!) of a an element that will hold the uploaded information. If not specified, useid+'_store' is the default. If such an element does not exist, a element is created. This element is where the uploaded information is stored. Thus, if it is within a , and is form element (such as or