Bug 118356 - [Curl] Download does not replace existing file.
Summary: [Curl] Download does not replace existing file.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Curl
Depends on:
Blocks:
 
Reported: 2013-07-03 06:09 PDT by peavo
Modified: 2013-07-15 11:27 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.67 KB, patch)
2013-07-03 06:19 PDT, peavo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!