#
# Password-protected file upload page
# -------------------------------------------------
# HTML/OS includes built-in Web-access security. So creating
# a password-protected file upload page screen is a matter of
# placing a form on a page with a File Upload option
# and having the form run an on-click overlay that checks the
# password entered by the user.
#
# This example uses a form to upload the file "upname".
# Note the use of multi-part form. This is required
# when uploading files.
#
# Tags used:
# IF .. THEN .. /IF
# DISPLAY .. /DISPLAY
# SYSCP
# GOTO
# PAGE
#
/#
# set some variables /#
formpassword="aestiva"
destinationfile="uploadedfile.txt"
uploadpassword=""
>>
Archive - Upload File
<<
# common technique for displaying message, if any /#
IF displaymessage <> "ERROR" DO
DISPLAY displaymessage + "
" /DISPLAY
displaymessage = "ERROR"
/IF
>>
< formpassword THEN
displaymessage =
"Bad Password - Try using AESTIVA"
GOTO PAGE
/IF
# NOTE: HTML/OS automatically places uploaded files in the
# upload directory, giving the file the name defined
# in the form. So our file is called "/upload/uploadfilename"
/#
IF uploadfilename <> "" DO
temp = SYSCP("/upload/uploadfilename",destinationfile)
IF temp = "" DO
displaymessage = "Upload Successful to "+destinationfile
ELSE
displaymessage = "Upload Not Successful" + uploadfilename
/IF
ELSE
displaymessage = "Bad Filename To Upload"
/IF
GOTO PAGE
>>