<<
file_folder="/upload_folder"
number_of_files=4
>>
<html>
<title>Upload Multiple Files</title>
<body bgcolor=white>
<<
IF err_msg != "ERROR" THEN
DISPLAY err_msg + "<br>" /DISPLAY
err_msg = "ERROR"
/IF
>>
<form method=post enctype="multipart/form-data" action=upthem><br>
<< i=1
WHILE i <= number_of_files DO
DISPLAY
'File #' + i + ': <input type=file size=30 name="' +
("F" + i + "_" + USERNUM) + '" ><br>'
/DISPLAY
i = i + 1
/WHILE
>>
<input type=submit value="Upload Now">
</form>
</body>
</html>
<<OVERLAY upthem
# H2O places uploaded files in the /upload folder.
# The uploaded file is given the same name as the
# variable in the <input type=file> statement.
/#
no_files_uploaded=0
i = 1
WHILE i <= number_of_files DO
uploadfile_name="/upload/" + ("F" + i + "_" + USERNUM+".txt")
void=FILEINFO(uploadfile_name)
IF void[2] != "" AND void[2] > 0 THEN
file_name=file_folder+"/file"+i+".txt"
FILEMOVE(uploadfile_name,file_name)
no_files_uploaded = no_files_uploaded + 1
ELSE
FILEREMOVE(uploadfile_name)
/IF
GOTO PAGE
i = i + 1
/WHILE
IF no_files_uploaded=0 THEN
err_msg = "<font color=red>No files uploaded</font>"
ELSE
err_msg = no_files_uploaded+ files uploaded"
/IF
GOTO PAGE
>>