<% Note: To modify for your system change /html/users/agencyhostcom/html to be your Web server's root and change /test to be your uploadf.htm directory %> File Upload <% DEFAULT host_filename=$filename$, filename="untitled", exists_opt="NO", upload_filename_size=0 %> <% IF $restore_file$ %>

RESTORE .BAK FILE: $restore_file$

<% SET hostname = $upload_dir$"/"$restore_file$ %> <% IF NOT fileExists($hostname$.bak) %>

FILE .BAK RESTORE FAILED

File $hostname$.bak does not exist

<% INCLUDE /html/users/agencyhostcom/html/fileupload/uploadf.htm %> <% EXIT %> <% ENDIF %> <% IF fileExists($hostname$) AND NOT deleteFile($hostname$) %>

FILE .BAK RESTORE FAILED

Error deleting existing file $hostname$
Error: $file_error$
<% INCLUDE /html/users/agencyhostcom/html/fileupload/uploadf.htm %> <% EXIT %> <% ENDIF %> <% IF NOT renameFile($hostname$.bak, $hostname$) %>

FILE .BAK RESTORE FAILED

Error renaming file $hostname$.bak to $hostname$
Error: $file_error$ <% ELSE %> Previous version of $hostname$ successfully restored. <% ENDIF %> <% ELSE 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/agencyhostcom/html/fileupload/uploadf.htm %> <% EXIT %> <% ENDIF %> <% ELSE IF $exists_opt$ = "OVERWRITE" %> <% IF deleteFile($hostname$) %> Previous version of $hostname$ deleted

<% ELSE %>

FILE UPLOAD FAILED

Error deleting previous version of $hostname$
Error: $file_error$

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


<% INCLUDE /html/users/agencyhostcom/html/fileupload/uploadf.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/agencyhostcom/html/fileupload/uploadf.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/agencyhostcom/html/fileupload/uploadf.htm %>