There is support for two files with the same name: _0, _1, etc. is added before the extension. This is done at upload. The correct link is displayed, but when in flexinode_file_download the database is queried, it looks at the serialized_data field for the filename, and that one hasn't _X in the name, so the entry is not found. A workaround follows. Change line 729 of flexinode.module (v1.46.2.2)

$result = db_fetch_object(db_query("SELECT f.* FROM {flexinode_data} f WHERE f.textual_data = '%s'", $file))

to look at the serialized_data instead, where the real filename is encoded:

$result = db_fetch_object(db_query("SELECT f.* FROM {flexinode_data} f WHERE f.serialized_data LIKE '%%\/%s\";%%'", $file));

This is not a foolproof method, but provides a workaround in most cases.

Comments

wvengen’s picture

Oops, I meant of course that flexinode_file_download currently looks at the textual_data_field and not at serialized_data.

espry’s picture

Brilliant! This works great for me, solved a very annoying proble. Files were uploaded, but not accessible through the web. I assume this might have been fixed in later versions of flexinode? Maybe the status of this bug should be updated?

Bèr Kessels’s picture

Status: Active » Needs work

please provide a proper patch. also note that file fields are NOT released, the main reason is that they don't work well! Which means: Don't use them!