[Webkit-unassigned] [Bug 136322] [GTK] WebKitDownload cannot overwrite existing file

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 28 00:23:48 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=136322


Carlos Garcia Campos <cgarcia at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #237271|review?, commit-queue?      |review-, commit-queue-
               Flag|                            |




--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com>  2014-08-28 00:23:54 PST ---
(From update of attachment 237271)
View in context: https://bugs.webkit.org/attachment.cgi?id=237271&action=review

Doing this unconditionally might be dangerous. I think it might make sense to allow overwrite when the destination has been set by the application explicitly, since apps are supposed to handle that situation when deciding the destination name, but we should document that. When the destination is decided automatically by WebKit, I'm not sure sure it's a good idea to overwrite existing file, though. The safest way would be to add API for that something like webkit_download_set_allow_overwrite()

> Source/WebKit2/ChangeLog:3
> +        [GTK] WebKitDownload cannot overwrite existing file

This is not a GTK specific issue, it affects all ports using libsoup as network backend.

> Source/WebKit2/Shared/Downloads/soup/DownloadSoup.cpp:140
> -        if (!g_file_move(m_intermediateFile.get(), destinationFile.get(), G_FILE_COPY_NONE, nullptr, nullptr, nullptr, &error.outPtr())) {
> +        if (!g_file_move(m_intermediateFile.get(), destinationFile.get(), G_FILE_COPY_OVERWRITE, nullptr, nullptr, nullptr, &error.outPtr())) {

I think this should be done using the allowOverwrite parameter of DecideDestinationWithSuggestedFilename message, so that clients can decide and it won't affect EFL in this case.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list