data.setContentDisposition(contentDisposition);
Bytes length = resourceStream.length();
if (length != null)
{
data.setContentLength(length.bytes());
}
data.setFileName(fileName);
String contentType = resourceStream.getContentType();
if (contentType == null && fileName != null && Application.exists())