Closed (fixed)
Project:
FileField
Version:
6.x-3.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2008 at 19:03 UTC
Updated:
18 Feb 2009 at 00:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
dopry commentedDoes it also create a duplicate copy of the file in the files folder?
Comment #2
amitaibuNo, it doesn't create a duplicate file (
FILE_EXISTS_REPLACE).Comment #3
dopry commentedhmm..well that is dirty... I guess we should correct it a some point.. do you have time to write a patch?
Comment #4
amitaibuI'd love to help. Can you point me in the right direction, i.e. how you would like it to be fixed.
[EDIT]: I've started working on a patch, i'll roll soon.
Comment #5
amitaibuAttached file makes sure that when FILE_EXISTS_REPLACE is used file isn't renamed and if a database record already exists it is updated.
Comment #6
drewish commentedWell this ties in nicely with a core issue: #334303: Handling overwriting of managed files (with unittests!). You reminded me that file_save_upload() also need to take replacement into account. That said I'm not sure we should be replacing a permanent fid with a temporary one...
Comment #7
dopry commentedupping to critical to keep it on my radar.
Comment #8
dopry commentedjust to make my life easier since this stuff is intended for filefield only... I removed the replace option all together... delete then update if you need to path to be saved correctly...
This also applies to field_file_save_upload.