بتاريخ: 7 أكتوبر 20178 سنة comment_290644 ده كود الميثود المسئوله عن حفظ الصوره في الجدول ولكن لا يتم حفظ الصوره في الجدول كامله نوع العمود في هذا اgجدول Blob public class FileUpload implements Serializable { private UploadedFile file; private RichImage imgsource; public FileUpload() { } private BlobDomain createBlobDomain(UploadedFile imgfile) { InputStream is = null; OutputStream out = null; BlobDomain domain = null; try { is = imgfile.getInputStream(); domain = new BlobDomain(); out = domain.getBinaryOutputStream(); byte[] buffer = new byte[8192]; int byteRead = 0; while ((byteRead = is.read(buffer, 0, 8192)) != -1) { out.write(buffer, 0, byteRead); } is.close(); out.close(); } catch (Exception e) { System.out.println(e.getMessage()); } return domain; } public void setFile(UploadedFile file) { this.file = file; } public UploadedFile getFile() { return file; } public String uploadImage_action() { UploadedFile imgfile = this.getFile(); BindingContext bindingctx = BindingContext.getCurrent(); BindingContainer bindingcnt = bindingctx.getCurrentBindingsEntry(); DCBindingContainer bindingImple = (DCBindingContainer) bindingcnt; DCIteratorBinding iterator = bindingImple.findIteratorBinding("CompanyView1Iterator"); Row row = iterator.getCurrentRow(); row.setAttribute("CompLogo", createBlobDomain(imgfile)); return null; } public void setImgsource(RichImage imgsource) { this.imgsource = imgsource; } public RichImage getImgsource() { return imgsource; }} تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.