How to upload a PDF

47 views
Skip to first unread message

Glyndwr Bartlett

unread,
Oct 5, 2017, 10:13:56 PM10/5/17
to gwtupload
I am using gwtupload; however, when I click on the upload button and select a pdf file the pdf image is not displayed and there is no error message. Do I need to use something else to allow the user to select a pdf file so I can save it to the database?

                        // Create a new uploader panel and attach it to a document
final SingleUploader defaultUploader = new SingleUploader();
defaultUploader.setAutoSubmit(true);
defaultUploader.setEnabled(true);
defaultUploader.avoidRepeatFiles(false);
defaultUploader.setMultipleSelection(false);
defaultUploader.setStyleName("gwt-TextBox");
// Add a finish handler which will load the image once the upload finishes
defaultUploader.addOnFinishUploadHandler(onFinishUploaderHandler);
defaultUploader.getFileInput().asWidget().setStyleName("customButton");
defaultUploader.getFileInput().asWidget().setSize("95px", "25px");

flexTableMedicalPlan.setWidget(1, 4, defaultUploader);
flexTableMedicalPlan.getCellFormatter().setVerticalAlignment(1, 4, HasVerticalAlignment.ALIGN_MIDDLE);
flexTableMedicalPlan.getCellFormatter().setHorizontalAlignment(1, 4, HasHorizontalAlignment.ALIGN_LEFT);
Reply all
Reply to author
Forward
0 new messages