Subversion Repositories SmartDukaan

Rev

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

Rev 9179 Rev 9182
Line 89... Line 89...
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
            System.out.println("attachment ...."+attachment);
94
            /*String attachmentString = "";
94
            String attachmentString = "";
95
            try {
95
            try {
96
            	attachmentString = URLEncoder.encode(attachment, "UTF-8");
96
            	attachmentString = URLEncoder.encode(attachment, "UTF-8");
97
    		} catch (UnsupportedEncodingException e) {
97
    		} catch (UnsupportedEncodingException e) {
98
    			System.out.println("Unable to encode the attachement file name");
98
    			System.out.println("Unable to encode the attachement file name");
99
    		}
99
    		}
100
    		System.out.println("attachmentString ...."+attachmentString);*/
100
    		System.out.println("attachmentString ...."+attachmentString);
101
            String fileName = CRMConstants.ATTACHMENTS_ARCHIVE_DIR + attachment;
101
            String fileName = CRMConstants.ATTACHMENTS_ARCHIVE_DIR + attachmentString;
102
            File file = new File(fileName);
102
            File file = new File(fileName);
103
            buffer = new byte[(int)file.length()];
103
            buffer = new byte[(int)file.length()];
104
            InputStream input = null;
104
            InputStream input = null;
105
            try {
105
            try {
106
                int totalBytesRead = 0;
106
                int totalBytesRead = 0;