[haiku-bugs] Re: [Haiku] #11632: [WebPositive] sometimes downloads files as "-0"

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Tue, 25 Aug 2015 10:10:52 -0000

#11632: [WebPositive] sometimes downloads files as "-0"
----------------------------------------+----------------------------
Reporter: diver | Owner: pulkomandy
Type: bug | Status: new
Priority: normal | Milestone: R1
Component: Applications/WebPositive | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
----------------------------------------+----------------------------

Comment (by pulkomandy):

It's not decrementing, but incrementing and prefixed with a dash :)

What happens is:
* WebKit somehow fails to provide a file name for the download
* The path ends up as download/folder/, which "already exists"
* The code then adds "-number" at the end of the name, until it finds
something that doesn't exist.

In normal cases this would lead to "download/folder/file.txt",
"download/folder/file.txt-0", "download/folder/file.txt-1", etc. With an
empty file name, only the -0 is left, and we get "download/folder/-0",
etc.

The name is extracted from HTTP Content-Disposition at

https://github.com/haiku/webkit/blob/rebased/Source/WebCore/platform/network/haiku/BUrlProtocolHandler.cpp#L477
. If that fails, the last part of the URL should be used.

--
Ticket URL: <https://dev.haiku-os.org/ticket/11632#comment:7>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: