Dodi
Dodi

Reputation: 11

download a file in inbox without opening a new tab in java gwt

i have developed an gwt project with java which is something like a web mail.i want to download an attached file in a mail and for this i make a url and use com.google.gwt.user.client.Window.open(url,"_blank", ""); after running this a tab opens and download dialog appears and tab closes but i want to show save download dialog without opening and closing the new tab. i want to have somthing like what gamil or ymail do while downloading attachments. here is my code:

 `final String url= "fetchAttachment.service?index="
        + mailData.getId().trim()
        + "&&"
        + "mailboxUid="
        + URL.encodeComponent(mailData
        .getMailBoxUid())
        + "&&"
        + "attachmentIndex="
    + mailData.getAttachments().get(i)
        .getIndex();
      CutLabel tempLabel = new CutLabel(attachemnts
     .get(i).getFileName(), 100);
      Window.open(url, "_blank", "");`

Upvotes: 1

Views: 960

Answers (1)

Hardik Mishra
Hardik Mishra

Reputation: 14887

Try this:

Window.open(url, "myWindow", "");

Upvotes: 0

Related Questions