Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1257

Filedownload.save(media, filename); is not returning as expected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.5.1
    • 6.0.1
    • Components
    • None

      Step 1,click upload button and upload an image with name "untitle",
      Step 2,click download to download the image,

      Expected : the downloaded file name is "not wat i wan"
      Actual : the downloaded file name is "untitlen"

      this is my zul file

      <window width="100%" apply="Test1Controller">
      	<button id="uploadBtn" label="Upload Image" upload="true,maxsize=300"></button>
      	<button id="download" label="download"></button>
      </window>
      

      this is my controller

      public class Test1Controller extends GenericForwardComposer {
      	protected Button uploadBtn;
      	
      	Media media;
      	public void doAfterCompose(Component comp) throws Exception {
      		super.doAfterCompose(comp);
      
      		uploadBtn.addEventListener(Events.ON_UPLOAD, new EventListener() {
      			@Override
      			public void onEvent(Event evt) throws InterruptedException, IOException {
      				filehandler(((UploadEvent) evt).getMedia());
      			}
      		});
      	}
      
      	private void filehandler(final Media media) throws InterruptedException, IOException {
      		this.media = media;
      	}
      
      	public void onClick$download() {
      		Filedownload.save(media, "not wat i wan.");
      	}
      }
      

            neillee neillee
            howjit82 howjit82
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: