Menu

#228 Needs to URL-escape Drag-and-Drop files

v1.0_(example)
closed-fixed
nobody
None
5
2018-07-17
2016-10-26
No

To convert each filename to a URI through Drag and Drop to send it to another application, XFE simply does this:

// Return URI of filename
FXString fileToURI(const FXString& file)
{
    return("file://"+file);
}

This is wrong. The file needs to be URL-encoded, so that compliant applications can properly read it. One consequence is that files whose filename is URL-encoded can't be opened.

For example, I have a wiki that saves files whose filenames are URL-encoded, so that characters such as '/' can be accepted as part of the page name. A filename for the page 'I/O handling', for example, would look like this: 'I%2FO%20handling.txt'. When dragging one such file to another application, it's URL-decoded by that application, and that results in a different filename than the original, and therefore it can't be opened by the other application.

Fixing this involves splitting the filename into sections separated by '/' and URL-encoding each section. That will properly preserve the slashes and URL-encode the rest.

Discussion

  • Roland Baudin

    Roland Baudin - 2018-07-17
    • status: open --> closed-fixed
     
  • Roland Baudin

    Roland Baudin - 2018-07-17

    This is fixed in version 1.43.
    Thanks for the bug report.

     

Log in to post a comment.

MongoDB Logo MongoDB