DWR

The name parameter for FileTransfer objects seems to be ignored (filename is a random hex value)

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: 3.0.RC1
  • Fix Version/s: 3.0.RC1
  • Component/s: Core
  • Description:
    Hide
    After returning a org.directwebremoting.io.FileTransfer object from a java method, the name parameter in the constructor seems to be ignored. Instead a random hex value is returned on the javascript side.

    This issue was already discussed here: http://www.nabble.com/Re%3A-What-is-the-proper-way-to-open-the-file-returned-by-FileTransfer--p15510849.html

    java:
    return new FileTransfer("filename.txt", "text/comma-separated-values", buffer.toByteArray());

    js:
    DownloadService.getFile( {
      callback: function(data) { window.open(data); } // data is a string pointing to /<context>/dwr/download/<random-hex-value>
    });

    Show
    After returning a org.directwebremoting.io.FileTransfer object from a java method, the name parameter in the constructor seems to be ignored. Instead a random hex value is returned on the javascript side. This issue was already discussed here: http://www.nabble.com/Re%3A-What-is-the-proper-way-to-open-the-file-returned-by-FileTransfer--p15510849.html java: return new FileTransfer("filename.txt", "text/comma-separated-values", buffer.toByteArray()); js: DownloadService.getFile( {   callback: function(data) { window.open(data); } // data is a string pointing to /<context>/dwr/download/<random-hex-value> });

Issue Links

Activity

Hide
Michael Benz added a comment - 18/Apr/08 1:36 PM

I must have missed ticket 202 which describes the same issue: http://getahead.org/bugs/browse/DWR-202

It is tagged as resolved in 3.0.M1, but i believe it still exists in 3.0.M2 and the current HEAD from the svn

Show
Michael Benz added a comment - 18/Apr/08 1:36 PM I must have missed ticket 202 which describes the same issue: http://getahead.org/bugs/browse/DWR-202 It is tagged as resolved in 3.0.M1, but i believe it still exists in 3.0.M2 and the current HEAD from the svn
Hide
Joe Walker added a comment - 30/Oct/08 1:49 PM

I have done some testing on this, and it currently appears that if you are using data: URLs then there is no way for DWR to pass a filename. The default is to use out-of-band download for all browsers now so this ought to crop up less often.

Show
Joe Walker added a comment - 30/Oct/08 1:49 PM I have done some testing on this, and it currently appears that if you are using data: URLs then there is no way for DWR to pass a filename. The default is to use out-of-band download for all browsers now so this ought to crop up less often.
Hide
Joe Walker added a comment - 30/Oct/08 1:50 PM

See comment on data: URLs

Show
Joe Walker added a comment - 30/Oct/08 1:50 PM See comment on data: URLs

People

Dates

  • Created:
    18/Apr/08 1:21 PM
    Updated:
    30/Oct/08 1:50 PM
    Resolved:
    30/Oct/08 1:50 PM