Index: src/org/apache/axis/attachments/MimeUtils.java
===================================================================
--- src/org/apache/axis/attachments/MimeUtils.java	(revision 738865)
+++ src/org/apache/axis/attachments/MimeUtils.java	(working copy)
@@ -93,9 +93,12 @@
             javax.activation.DataHandler dh = bp.getDataHandler();
             javax.activation.DataSource ds = dh.getDataSource();
 
+            if( ds instanceof ContentLength ){
+            	dataSize = ((ContentLength)ds).getContentLength();
+            }
             // Do files our selfs since this is costly to read in. Ask the file system.
             // This is 90% of the use of attachments.
-            if (ds instanceof javax.activation.FileDataSource) {
+            else if (ds instanceof javax.activation.FileDataSource) {
                 javax.activation.FileDataSource fdh =
                         (javax.activation.FileDataSource) ds;
                 java.io.File df = fdh.getFile();
