View Issue Details

IDProjectCategoryView StatusLast Update
0009495mantisbttoolspublic2010-09-19 03:13
ReporterBuga Assigned Torolfkleef  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionduplicate 
Product Version1.1.1 
Summary0009495: Attachment Tool overwrites files with the same name
Description

Hi
I needed to change the way how Mantis stores the attachements. I have arround 300mb attachements stored in the database and now switched to save them on the disk. The problem is that the standard utility for this copys the attachments with their real names to disk. If I add an attachment manually it get stored with a unique hash code as name like f20fcae4a103ecaa331f48abc04e4ce2.
The problem is that attachments with the same name get overriden this way.

Additional Information

I checked the move_db2disk.php and changed 2 lines to achieve that the files get saved with the unique name instead of the realname on disk.

line 123:
from $t_file_name = $t_real_file_path . $c_filename;
to $t_file_name = $t_real_file_path . $v_diskfile ;

and line 131:
from $c_new_file_name = db_prepare_string( $t_file_path . $c_filename );
to $c_new_file_name = db_prepare_string( $t_file_path . $v_diskfile );

Dunno if this is really a bug but perhaps it helps some people who have the same problem.

TagsNo tags attached.

Relationships

duplicate of 0007176 closeddregad Move Attachments to Disk: data loss due to filename overwrite 

Activities

giallu

giallu

2008-08-06 08:52

reporter   ~0019063

yes, it is.

The support program for moving the attachment from DB to DISK methods should handle the transition properly: i.e. attachments on bugs should still work after the operation

vboctor

vboctor

2008-08-10 01:55

manager   ~0019101

Sounds like the script wasn't updated when the way attachments are handled in Mantis was changed. Patches are welcome.

rolfkleef

rolfkleef

2010-06-11 14:08

reporter   ~0025815

more detailed discussion and patch in 0007176