<%@ Import Namespace="HTCOMNET.Main" %>
<%@ Page CodeBehind="Upload.aspx.vb" Language="vb" AutoEventWireup="false" Inherits="HTCOMNET.Upload" %>
<html>
<head>
<title>Upload files</title>
<meta http-equiv="Content-Type" content="text/html; charset=<%=Session(SK_CHARSET)%>">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<link rel="stylesheet" href="Scripts<%=JS_CSS_VERSION%>/Style.css" type="text/css">
<SCRIPT language="JavaScript" src="Scripts<%=JS_CSS_VERSION%>/<%=Session(SK_LANGUAGE).Language%>.js"></SCRIPT>
<SCRIPT language="JavaScript" src="Scripts<%=JS_CSS_VERSION%>/Main.js"></SCRIPT>
<SCRIPT language="JavaScript" src="Scripts<%=JS_CSS_VERSION%>/Upload.js"></SCRIPT>
</head>
<%
Dim MaxString as String
IF Session(SK_CURRENT_FOLDER).maxfilesize<>0 THEN
	if Flash8Mode andalso Session(SK_CURRENT_FOLDER).maxfilesize>104857600 then
		MaxString = Session(SK_LANGUAGE).GetText("MAX_FILE_SIZE") & " <b>100 MB</b>!<br>" 
	else
		MaxString = Session(SK_LANGUAGE).GetText("MAX_FILE_SIZE") & " <b>" & FormatSize(Session(SK_CURRENT_FOLDER).maxfilesize) & "</b>!<BR>"
	end if
ELSE	
	if Flash8Mode then
		MaxString = Session(SK_LANGUAGE).GetText("MAX_FILE_SIZE") & " <b>100 MB</b>!<BR>" 
	else
		MaxString = Session(SK_LANGUAGE).GetText("TOTAL_MAX_FILE_SIZE") & " <b>1 GB</b>!<BR>" 
	end if
END IF
%>
<%
If Not Session(SK_CURRENT_FOLDER).CanUpload Then Exit Sub

IF request.querystring("refreshlist")="1" THEN%>
<script language="Javascript">
window.opener.parent.List.location.href="list.aspx"
if(window.opener.parent.topFrame.progressbarwindow)
{
window.opener.parent.topFrame.progressbarwindow.close()
}
if(window.opener.parent.topFrame.ftpwindow)
{
window.opener.parent.topFrame.ftpwindow.close()
}
</script>
<%END IF%>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="5" topmargin="5">
<script language="JavaScript">
drawupwin('<font color="#FFFF66">&nbsp;&nbsp;<%=Session(SK_LANGUAGE).GetText("FILE_UPLOAD")%></font>', Innerwidth()-15, Innerheight()-15,'#F8F6E6');
</script>
<form   name="myform" method="post"  enctype="multipart/form-data">
<%If Session(SK_ERROR_MESSAGE) <> "" Then%>
<font class="subactionsfont"><BR>
&nbsp;&nbsp;<%=BigErrorHTML%>&nbsp;<%=Session(SK_ERROR_MESSAGE)%></font>
<%Session(SK_ERROR_MESSAGE)=""
end if%>
   <%IF Session(SK_UPLOADED_FILES)<>"" THEN%>
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="30">&nbsp;</td>
		<td>				
			<font class="subactionsfont"><BR>
				<%=Session(SK_UPLOADED_FILES)%>
			<BR>
			</font>
		</td>
	</tr>
	</table>
   <%
    Session(SK_UPLOADED_FILES) = ""
    Session(SK_ERROR_MESSAGE) = ""
   end if%> 
<%if FTPMode then%>
<script language="JavaScript">
document.write('<iframe style="border-top: #7f9db9 1px solid;border-bottom: #7f9db9 1px solid;" scrolling="auto"  height="' + (Innerheight()-200) + '" width="100%" src="<%=FTP_ADDRESS%>"></iframe>')
</script>
<p class="info">
<%=MaxString%>
<%=string.format(Session(SK_LANGUAGE).GetText("FTP_HELP"),"<BR>")%></p>
<%elseif Flash8Mode then%>
<object  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="450" height="300" ID="Shockwaveflash1" VIEWASTEXT>
  <param name="movie" value="multipleupload.swf" />
  <param name="quality" value="high" />
  <param name="flashvars" value="uploadUrl=netupload.aspx?flash8=true&maxFileSize=104857600" />
  <embed src="multipleupload.swf" flashvars="uploadUrl=netupload.aspx?flash8=true&maxFileSize=104857600" quality="high" 
  pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="450" height="300"> </embed>
</object>
<p class="info">
<%=MaxString%>
<%=string.format(Session(SK_LANGUAGE).GetText("FLASH8_HELP"),"<BR>")%></p>
<%else%>  
<br>
  <table width="450" border="0" cellspacing="0" cellpadding="0">
    <tr height="40">
     <td><div id="files">&nbsp;&nbsp;<input onFocus="javascript: if(ie50)addfile();"  onChange="javascript: addfile();" class="file" type="file" name="file1" id="file1" style="width:440;"></div></td>
     </tr>       
  </table>
<%end if%>
<%if ClassicMode or FTPMode then%>
  <table width="200" border="0" cellspacing="0" cellpadding="0">
    <tr height="40">
     <td align="left">
     &nbsp;
     <%if ClassicMode then%>
     &nbsp;&nbsp;&nbsp;<input name="UplButton" type="button" class="button" onclick="javascript: doupload('<%=Javaformat(Session(SK_CURRENT_FOLDER).Unuploaded)%>', <%=ASPBooleantoJava(USE_SYSTEM_NET_UPLOAD)%>);" value=" <%=Session(SK_LANGUAGE).GetText("UPLOAD")%> ">
     <p class="info"><%=MaxString%></p>
     <%elseif FTPMode then%>
     &nbsp;&nbsp;&nbsp;<input name="UplButton" type="button" class="button" onclick="javascript: ftpdoupload();" value=" <%=Session(SK_LANGUAGE).GetText("COPY_TO_FOLDER")%> ">
     <input type="hidden" name="RNDIND" value="<%=RNDIND%>">  
     <%end if%>
     </td> 
     <%IF FTPMode then%>
     <td width="50" align="left">&nbsp;<a title="<%=Session(SK_LANGUAGE).GetText("SHOW_FTP_FOLDER_IN_SEPARATE_WINDOW")%>" href="javascript:showftpwindow('<%=javaformat(FTP_ADDRESS)%>')">
	 <img  width="32" height="32" border="0" alt="<%=Session(SK_LANGUAGE).GetText("SHOW_FTP_FOLDER_IN_SEPARATE_WINDOW")%>" src="images/XP_ftpnew.gif"></a></td>
     <%End if%>   
     </tr>  
  </table>
  <%end if%>
  <p align="right">
    <%if Not ClassicMode then%>
<a target="_self" title="<%=Session(SK_LANGUAGE).GetText("SWITCH_TO_CLASSIC_MODE")%>" href="Upload.aspx"><u><font size="3" color="#333399"><b><%=Session(SK_LANGUAGE).GetText("CLASSIC_UPLOAD")%></b></font></u>&nbsp;<img  width="32" height="26" border="0" alt="<%=Session(SK_LANGUAGE).GetText("SWITCH_TO_CLASSIC_MODE")%>" src="images/XP_ClassicUpload.gif"></a>&nbsp;&nbsp;&nbsp;
     <%end if%>   
     <%if USE_FTP_UPLOAD_DOWNLOAD and not FTPMode then%>
<a target="_self" title="<%=Session(SK_LANGUAGE).GetText("SWITCH_TO_FTP_MODE")%>" href="Upload.aspx?ftpmode=yes"><u><font size="3" color="#333399"><b><%=Session(SK_LANGUAGE).GetText("FTP_UPLOAD")%></b></font></u>&nbsp;<img  width="31" height="31" border="0" alt="<%=Session(SK_LANGUAGE).GetText("SWITCH_TO_FTP_MODE")%>" src="images/XP_ftp.gif"></a>&nbsp;&nbsp;&nbsp;
     <%end if%>
     <%if not request.IsSecureConnection and USE_FLASH8_UPLOAD and Not Flash8Mode then%>
<a target="_self" title="<%=Session(SK_LANGUAGE).GetText("SWITCH_TO_FLASH8_MODE")%>" href="Upload.aspx?flash8mode=yes"><u><font size="3" color="#333399"><b><%=Session(SK_LANGUAGE).GetText("FLASH_UPLOAD")%></b></font></u>&nbsp;<img  width="32" height="32" border="0" alt="<%=Session(SK_LANGUAGE).GetText("SWITCH_TO_FLASH8_MODE")%>" src="images/flash8upload.gif"></a>&nbsp;&nbsp;&nbsp;
     <%end if%>
    </p>
 </form>
<script language="JavaScript">
drawdownwin('');
</script>
</body>
</html>
