<% DEFAULT host_filename=$filename$, filename="untitled", exists_opt="NO", upload_filename_size=0 %> <% IF $upload_filename$ %>

FILE UPLOAD: $host_filename$

<% SET hostname = $upload_dir$"/"$host_filename$ %> <% IF fileExists($hostname$) %> <% IF $exists_opt$ = "SAVE" %> <% SET delprevsaved = deleteFile($hostname$.bak) %> <% IF renameFile($hostname$,$hostname$.bak) %> Previous version of $hostname$ renamed to $hostname$.bak

<% ELSE %>

FILE UPLOAD FAILED

Error renaming previous version of $hostname$ to $hostname$.bak
Error: $file_error$

<% IF NOT deleteFile($upload_filename$) %> Couldn't delete upload file: $upload_filename$ - $file_error$

<% ENDIF %>


<% INCLUDE /html/users/$AgencyWebName$com/html/$AgencyDirectory$/proceduresupload.htm %> <% EXIT %> <% ENDIF %> <% ELSE %>

FILE UPLOAD FAILED

File $hostname$ alread exits

<% IF NOT deleteFile($upload_filename$) %> Couldn't delete upload file: $upload_filename$ - $file_error$ <% ENDIF %>


<% INCLUDE /html/users/$AgencyWebName$com/html/$AgencyDirectory$/proceduresupload.htm %> <% EXIT %> <% ENDIF %> <% ENDIF %> <% IF NOT renameFile($upload_filename$,$hostname$) %>

FILE UPLOAD FAILED

Error renaming uploaded file to $hostname$
Error: $file_error$

<% IF NOT deleteFile($upload_filename$) %> Couldn't delete upload file: $upload_filename$ - $file_error$ <% ENDIF %> <% ELSE %> <% IF $upload_filename_size$ > 0 %> File $hostname$ successfully uploaded, $upload_filename_size$ bytes. <% ELSE %> File $hostname$ was uploaded, but the file size is 0.

The file may not actually exist on your system. Check directory and spelling. <% ENDIF %> <% ENDIF %> <% ELSE IF $odbic_error$ %>

FILE UPLOAD FAILED

No file uploaded. $odbic_error$ <% ENDIF %>
<% INCLUDE /html/users/$AgencyWebName$com/html/$AgencyDirectory$/proceduresupload.htm %>