Despite the text below a file field reading: "If you upload another file, the current file will be replaced.", if you upload an identical named file it will not be replaced. It will create a new file with _0, _1 ... _n appended. Though, the funny thing is, the old file will be deleted and the link stored is to the OLD file name. i.e. the one without _n on the end. So causing the link not to work and to instead take you to 'Access Denied'.
I've traced the issue to line 51 in file.inc.
Instead of:
if ($file = file_save_upload($fieldname, variable_get('file_directory_path', NULL))) {
You need to have:
if ($file = file_save_upload($fieldname, variable_get('file_directory_path', NULL), TRUE)) {
I don't know if this is correct. But it seems to work.
Thanks
Adam
Comments
Comment #1
cooperaj commentedI'm going to go ahead and close this issue. It's been open a long while and no changes have been made.
Is this module even maintained any more.
I'll check back in a week and close it then.
Comment #2
cooperaj commentedNo comments so I'm closing it.