#include "vely.h"
request-handler /temphist
out-header default
task-param action
if-task "record"
input-param temp
run-query @db_utility = "insert into temps (temp, timest) values ('%s', current_timestamp)" : temp \
affected-rows define rc error-text define er no-loop
if (rc != 1) {
@Could not insert temperature reading, error <<p-out er>>.
} else {
@Temperature reading stored.
}
else-task "list"
run-query @db_utility = "select temp, timest from temps order by timest" output temp, timest
@Date: <<query-result timest>>
@Temperature: <<query-result temp>>
end-query
end-task
end-request-handler
#include "vely.h"
request-handler /upload
out-header default
input-param filedesc
input-param file_filename
input-param file_location
input-param file_size
input-param file_ext
@<h2>Uploading file</h2>
run-query @db_file_manager= \
"insert into files (fileName, localPath, extension, description, fileSize) \
values ('%s', '%s', '%s', '%s', '%s')" \
input file_filename, file_location, file_ext, filedesc, file_size
end-query
@File <<p-web file_filename>> of size <<p-web file_size>> \
is stored on server at <<p-web file_location>>. \
File description is <<p-web filedesc>>.<hr/>
end-request-handler
You are free to copy, redistribute and adapt this web page (even commercially), as long as you give credit and provide a link back to this page (dofollow) - see full license at
CC-BY-4.0. Copyright (c) 2019-2023 Dasoftver LLC. Vely and elephant logo are trademarks of Dasoftver LLC. The software and information on this web site are provided "AS IS" and without any warranties or guarantees of any kind.