<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit, com.novell.emframe.dev.eMFrameUtils, com.novell.nps.utils.Utils" %>
<%   JSPConduit c = JSPConduit.getJSPConduit(request);
   c.stringTable("DevResources"); 
   c.stringTable("BaseResources"); %>
<HTML>
<HEAD>
<TITLE>Download File</TITLE>
</HEAD>

<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF">
<form name="DownloadFileForm" method=post action="webacc">
   <input type=hidden name="taskId" value="fw.HomePage">
   <input type=hidden name="merge" value="fw.HomePage">
   <input type=hidden name="User.context" value="<%= c.var("User.context") %>">
   
   <BR><FONT size=+1 color=#000080><B>This page is for testing downloading a file.</B></FONT><BR><BR>
   <% c.set("debugMime", "text/html"); 
      c.set("debugFile", "iManager.html"); %>
   <a href="webacc/<%= c.var("User.context") %>/eMFrame/iManager.xml?User.context=<%= c.var("User.context") %>&taskId=fw.DownloadFile&file=portal/modules/base/install/iManager.xml">Download iManager.xml (Should succeed)</a><br>
   <a href="webacc/<%= c.var("User.context") %>/eMFrame/<%= Utils.urlEncode(c.var("russianfilename")) %>?User.context=<%= c.var("User.context") %>&taskId=fw.DownloadFile&file=<%= Utils.urlEncode(c.var("russianfilename")) %>">Download <%= c.toDisplay(c.var("russianfilename")) %> (Should succeed)</a><br>
   <a href="webacc/<%= c.var("User.context") %>/eMFrame/invalid.txt?User.context=<%= c.var("User.context") %>&taskId=fw.DownloadFile&file=WEB-INF/invalid.txt">Download invalid.txt (Should fail)</a><br>
   <a href="webacc/<%= c.var("User.context") %>/eMFrame/<%= c.replaceWith((c.urlEncode(c.var("debugFile"))), "%2e", ".") %>?User.context=<%= c.var("User.context") %>&taskId=fw.DownloadFile&mimetype=<%= Utils.urlEncode(c.var("debugMime")) %>&file=/<%= c.replaceWith((c.urlEncode(c.var("debugFile"))), "%2e", ".") %>">Download iManager.html (with mime type specified) (Should succeed)</a><br>
   <INPUT type=image name="OK" alt="<%= c.string("Button.OK.alt") %>" src="<%= c.getModulesUrl() + "/dev/images/" + c.string("Button.OK.image") %>" border=0>
   </FONT>
</form>
</BODY></HTML>
