Subversion Repositories SmartDukaan

Rev

Rev 9175 | Rev 9179 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9175 Rev 9177
Line 88... Line 88...
88
        byte[] buffer = null;
88
        byte[] buffer = null;
89
        try {
89
        try {
90
            if (attachment == null || attachment.isEmpty()) {
90
            if (attachment == null || attachment.isEmpty()) {
91
                throw new Exception("File name is empty");
91
                throw new Exception("File name is empty");
92
            }
92
            }
-
 
93
            System.out.println("attachment ...."+attachment);
93
            String attachmentString = "";
94
            String attachmentString = "";
94
            try {
95
            try {
95
            	attachmentString = URLEncoder.encode(attachment, "UTF-8");
96
            	attachmentString = URLEncoder.encode(attachment, "UTF-8");
96
    		} catch (UnsupportedEncodingException e) {
97
    		} catch (UnsupportedEncodingException e) {
97
    			System.out.println("Unable to encode the attachement file name");
98
    			System.out.println("Unable to encode the attachement file name");
98
    		}
99
    		}
-
 
100
    		System.out.println("attachmentString ...."+attachmentString);
99
            String fileName = CRMConstants.ATTACHMENTS_ARCHIVE_DIR + attachmentString;
101
            String fileName = CRMConstants.ATTACHMENTS_ARCHIVE_DIR + attachmentString;
100
            File file = new File(fileName);
102
            File file = new File(fileName);
101
            buffer = new byte[(int)file.length()];
103
            buffer = new byte[(int)file.length()];
102
            InputStream input = null;
104
            InputStream input = null;
103
            try {
105
            try {