ERAttachment attachment = fetchAttachmentFor(editingContext, requestedAttachmentID, requestedWebPath);
if (_delegate != null && !_delegate.attachmentVisible(attachment, request, context)) {
throw new SecurityException("You are not allowed to view the requested attachment.");
}
mimeType = attachment.mimeType();
length = attachment.size().longValue();
fileName = attachment.originalFileName();
ERAttachmentProcessor<ERAttachment> attachmentProcessor = ERAttachmentProcessor.processorForType(attachment);
if (!proxyAsAttachment) {
proxyAsAttachment = attachmentProcessor.proxyAsAttachment(attachment);