New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download a URL with no name or content disposition headers #840

fyrewall77 opened this Issue Oct 19, 2018 · 1 comment


None yet
3 participants

fyrewall77 commented Oct 19, 2018

The problem

Trying to download this image:
but the File it tries to download to is the reports directory, not a file inside the reports directory.


Looks like this URL doesnt have a file name, nor does the server return a content disposition header.

Expected result

Some random File in the reports directory, not an exception.

Tell us about your environment

  • Selenide Version: 4.14.2

Code To Reproduce Issue [ Good To Have ]

Configuration.reportsFolder = "/tmp";"");

Bug location:
in DownloadFileWithHttpRequest.getFileName(), you make a call to FilenameUtils.getName(fileToDownloadLocation). which gets the name of the file from the end of the url. The URL specified in this enable has no file, so the resulting File is simply the reports directory. Whatever the file returned from here should not exist yet.

Change Requested:

if(fullFileName.isEmpty()) {
  return UUID.generate.tostring?;


File target = FileUtils.createRandomFile();"", target);

@asolntsev asolntsev self-assigned this Nov 4, 2018

@asolntsev asolntsev added this to the 5.0.1 milestone Nov 4, 2018


This comment has been minimized.


asolntsev commented Nov 4, 2018

@fyrewall77 Thank you for reporting the issue! We will fix it in next release.

@asolntsev asolntsev added the bug 🐛 label Nov 4, 2018

asolntsev added a commit that referenced this issue Nov 7, 2018

asolntsev added a commit that referenced this issue Nov 7, 2018

@rosolko rosolko modified the milestones: 5.0.1, 5.0.2 Nov 8, 2018

@rosolko rosolko closed this Nov 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment