Cuba Platform !!exclusive!! Download: File
The server responds with a 200 OK status, a Content-Disposition: attachment header, and the binary stream. 5. Performance and Optimization Best Practices
@Inject private Link downloadLink; @Subscribe public void onInit(InitEvent event) { FileDescriptor file = getTargetFile(); downloadLink.setResource(new FileResource(file)); downloadLink.setCaption(file.getName()); } Use code with caution. 3. Programmatic Downloading via Controller Code cuba platform download file
While designed for uploads, this component natively supports downloading previously uploaded files when clicked. The server responds with a 200 OK status,