Bug 118356

Summary: [Curl] Download does not replace existing file.
Product: WebKit Reporter: peavo
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, galpeter
Priority: P2 Keywords: Curl
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description peavo 2013-07-03 06:09:49 PDT
If the download target file already exists, it is not replaced after the download has finished.
At this point, the user would have already approved to replace the file, so it should be replaced.
Comment 1 peavo 2013-07-03 06:19:32 PDT
Created attachment 205997 [details]
Patch
Comment 2 Peter Gal 2013-07-15 01:30:16 PDT
Well I'm not a reviewer but this looks good to me. 

I've just got one (two) question(s) if the MoveFileEx fails then the old file will be still there? and if so won't that cause problems?
Comment 3 peavo 2013-07-15 10:26:56 PDT
(In reply to comment #2)
> Well I'm not a reviewer but this looks good to me. 
> 
> I've just got one (two) question(s) if the MoveFileEx fails then the old file will be still there? and if so won't that cause problems?

Thanks for commenting :)

I think this scenario should be ok, as the old file is a temporary file in a Windows temp folder. The next download will generate a new, unique, temporary file name, to download to, and not have any references to the previous temporary file.
Comment 4 Brent Fulgham 2013-07-15 10:59:57 PDT
Comment on attachment 205997 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2013-07-15 11:22:21 PDT
Comment on attachment 205997 [details]
Patch

Clearing flags on attachment: 205997

Committed r152649: <http://trac.webkit.org/changeset/152649>
Comment 6 WebKit Commit Bot 2013-07-15 11:22:23 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 peavo 2013-07-15 11:27:30 PDT
(In reply to comment #4)
> (From update of attachment 205997 [details])
> r=me

Thanks for reviewing!