<%@ LANGUAGE="JSCRIPT" %>
<% if(!User.CanUpload && !User.IsAdministrator) { Response.Write("

No permission to upload

"); } else { if(Request.ServerVariables("request_method").toLowerCase() != "post") { %> Select a file to be uploaded to the <%= tgtPath %> directory:
">
Upload File <% } else { // // POST: Move the file from it's temporary location to its final // location. // if(Request.Form("FileName")) { // Did upload the file var fso = new ActiveXObject("Scripting.FileSystemObject"); var dest = Server.MapPath(Request.Form("DestPath")) + "\\" + fso.GetFileName(Request.Form("FilePath")); if(dest.toLowerCase() != Request.Form("FilePath").toLowerCase()) { try { fso.CopyFile(Request.Form("FilePath"), dest, true); // Replace fso.DeleteFile(Request.Form("FilePath")); Response.Write("\nFile uploaded successfully. " + "Click Refresh to update the file list. Upload another."); } catch(ex) { Response.Write("\nFailed: " + (ex.message ? ex.message : ex) + " Try again."); } } else Response.Write("\nFile uploaded successfully. " + "Click Refresh to update the file list. Upload another."); } else Response.Write("\nNo file. Try again."); } } %>