| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Program Files (x86)/Mail Enable/Bin/NETWebMail/Mobile/ |
Upload File : |
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Compose.aspx.vb" Inherits="MailEnable.Clients.WebMail.Mobile.Compose" %>
<%@ Register TagPrefix="m" TagName="Document" Src="Controls/Document.ascx" %>
<%@ Register TagPrefix="m" TagName="Page" Src="Controls/Page.ascx" %>
<%@ Register TagPrefix="m" TagName="TextBox" Src="Controls/TextBox.ascx" %>
<%@ Register TagPrefix="m" TagName="FeedbackMessage" Src="Controls/FeedbackMessage.ascx" %>
<m:Document ID="Document1" runat="server">
<Content>
<script language="javascript">
function getComposeId() {
return '<%=MessageId%>';
}
</script>
<m:Page Title="Compose" Id="ComposePage" runat="server">
<Content>
<script language="javascript">
function getComposeId() {
return '<%=MessageId%>';
}
function getSelectedAttachment() {
return $("#ddlAttachments").val();
}
function getSelectedFolder() {
return 'Drafts';
}
function clearUploadSelector() {
var control = $("#file");
control.replaceWith(control = control.clone(true));
}
function removeAttachment() {
$('#jsSend').button('disable');
$('#jsSave').button('disable');
$.ajax({
url: getPageServletURL() + '?Cmd=REMOVE-ATTACHMENT&ID=' + getComposeId() + '&Attachment=' + getSelectedAttachment() + '&Folder=' + getSelectedFolder() + '&TD=' + (new Date()).getTime() + '&ME_VALIDATIONTOKEN=<% =Session.Item("ME_VALIDATIONTOKEN") %>',
cache: false,
contentType: false,
processData: false,
type: 'GET',
success: function (data) {
if (data && (data.length > 0)) {
try {
$("#ddlAttachments option[value='" + getSelectedAttachment() + "']").remove();
var ddl = $("#ddlAttachments");
// if we have no attachments, hide the list or show no attachments with button disabled.
if (ddl.children('option').length <= 0) {
ddl.append($("<option></option>").attr("value", "No Attachments Available").text("No Attachments Available"));
ddl.selectmenu('disable');
$('#jsDelete').prop('disabled',true); //this seems to work
$('#jsDelete').button('disable'); //note: this does not seem to work on all browsers
}
} catch (ex) { }
$('#ddlAttachments').selectmenu('refresh');
}
else { alert('no data'); }
},
error: function (request, error) {
alert("An error occured removing: " + error);
},
complete: function (jqXHR, sTextstatus) {
$('#jsSend').prop('disabled',false);
$('#jsSend').button('enable');
$('#jsSave').prop('disabled',false);
$('#jsSave').button('enable');
}
})
}
function BindAddAttachment()
{
$(':file').unbind('change'); //remove previous handler(s)
$(':file').change(function () {
if (this.files) {
$('#jsSend').prop('disabled',true); //this seems to work
$('#jsSend').button('disable');
$('#jsSave').prop('disabled',true); //this seems to work
$('#jsSave').button('disable');
var file = this.files[0];
if (file) {
$("#prgUpload").val("0"); //reset it
$('#prgUpload').show();
$.ajax({
url: getPageServletURL() + '?Cmd=ATTACH-FILES&ID=' + getComposeId() + '&TD=' + (new Date()).getTime() + '&ME_VALIDATIONTOKEN=<% =Session.Item("ME_VALIDATIONTOKEN") %>',
data: new FormData($('#fmUpload').get(0)),
cache: false,
contentType: false,
processData: false,
type: 'POST',
success: function (data) {
if (data && (data.length > 0)) {
try {
//empty the list and enable it, if it is disabled
var attr = $('#ddlAttachments').attr('disabled');
if (typeof attr !== typeof undefined && attr !== false) {
$('#ddlAttachments').empty().removeAttr('disabled');
}
$("#ddlAttachments option[value='No Attachments Available']").remove();
$.each(data, function (i, item) {
$('#ddlAttachments').append($("<option></option>").attr("value", item['FileName']).text(item['DisplayFilename']));
});
//$('#ddlAttachments option:last').prop('selected', true);
$('#ddlAttachments').selectmenu('enable');
$('#jsDelete').prop('disabled',false);
} catch (ex) {
}
$('#ddlAttachments').selectmenu('refresh');
}
},
error: function (request, error) {
alert("An error occured uploading: " + error);
},
complete: function (jqXHR, sTextstatus) {
if (typeof clearUploadSelector !== 'undefined') {
clearUploadSelector();
}
$('#prgUpload').hide();
$('#uploader').hide();
$('#jsSend').prop('disabled',false);
$('#jsSend').button('enable');
$('#jsSave').prop('disabled',false);
$('#jsSave').button('enable');
},
processData: false,
xhr: function () {
var myXhr = $.ajaxSettings.xhr();
if (myXhr.upload) {
myXhr.upload.addEventListener('progress', function (e) {
if (e.lengthComputable) {
$('progress').attr({
value: e.loaded,
max: e.total
});
}
}, false);
}
return myXhr;
}
})
}
else {
alert('unable to upload');
}
}
else {
alert('no support');
}
});
}
function addAttachment() {
BindAddAttachment();
document.getElementById('file').click();
}
$(document).ready(function () {
BindAddAttachment();
});
function getPageServletURL() {
var rootURL = location.protocol + '//' + location.host + location.pathname
return rootURL;
}
</script>
<form id="frmCompose" name="frmCompose" action="Compose.aspx?Mode=<%= Mode %>&Message=<%=MessageId %>&TS=<%=Now().Ticks%>" method="post"><%WriteFormValidationField()%>
<m:TextBox ID="ToRecipients" Label="To" Type="email" Multiple="true" Focused="true" runat="server" />
<div id="ComposeAutoComplete"></div>
<m:TextBox ID="Subject" Label="Subject" runat="server" />
<div data-role="collapsible" data-content-theme="c">
<%If AllowAttachments() Then%>
<h3>Add Cc, Bcc or Attachments</h3>
<%Else%>
<h3>Add Cc or Bcc</h3>
<%End If%>
<m:TextBox ID="CcRecipients" Label="Cc" Type="email" Multiple="true" runat="server" />
<m:TextBox ID="BccRecipients" Label="Bcc" Type="email" Multiple="true" runat="server" />
<%If AllowAttachments() Then%>
<div class="ui-grid-b" style="width:100%">
<div class="ui-block-a">
<select name="ddlAttachments" id="ddlAttachments" <%=GetDisabledAttribute(Not HasAttachments())%> >
<%If Not HasAttachments() Then%>
<option selected="selected" value="No Attachments Available">No Attachments Available</option>
<%
Else
For Each oRow As System.Data.DataRow In dsAttachments.Tables(0).Rows%>
<option value="<%=System.Web.HttpUtility.UrlEncode(oRow("ContentDepositionFileName"))%>"><%=System.Web.HttpUtility.UrlEncode(oRow("ContentDepositionFileName"))%></option>
<% Next
End If%>
</select>
</div>
<div class="ui-block-b"><button id="jsUpload" name="Upload" type="button" onclick="addAttachment();" data-theme="b" data-iconpos="right"><%=GetText("[ME_TXT-Add]")%></button></div>
<div class="ui-block-c"><button id="jsDelete" <%=GetDisabledAttribute(Not HasAttachments())%> name="Delete" type="button" onclick="removeAttachment();" data-theme="b" data-iconpos="right"><%=GetText("[ME_TXT-Remove]")%></button></div>
</div>
<div style="width:100%"><progress id="prgUpload" style="height: 16px;width:100%;display:none"></progress></div>
<%End If %>
</div>
<div class="textarea">
<m:TextBox ID="Body" Label="Body" LabelVisible="false" Placeholder="Message Content" Multiline="true" runat="server" />
</div>
<div class="ui-grid-b bttn_grid3_shell right">
<div class="ui-block-a"><input type="submit" id="jsSend" name="Submission" value="<%=GetText("[ME_TXT-Send]")%>" data-theme="b" data-iconpos="right" data-icon="arrow-r"/></div>
<div class="ui-block-b"><input type="submit" id="jsSave" name="Submission" value="<%=GetText("[ME_TXT-Save]")%>"/></div>
<div class="ui-block-c"><a data-role="button" data-rel="back" ><%=GetText("[ME_TXT-Cancel]")%></a></div>
</div>
</form>
<div id="uploader" style="position:absolute; top:200px;left:200px;">
<form id="fmUpload" name="fileupload" enctype="multipart/form-data" action="" data-ajax="false">
<input id="file" name="file" type="file" style="display: none;" />
</form>
</div>
<m:FeedbackMessage ID="Feedback" Visible="false" runat="server" />
</Content>
</m:Page>
</Content>
</m:Document>