Needs work
Project:
FileField Sources
Version:
7.x-1.x-dev
Component:
Source: Attach (FTP)
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2012 at 10:05 UTC
Updated:
21 Apr 2016 at 15:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
quicksketchThis would be a great improvement. I'm sure it's possible in some way but the FileAPI makes using file move less than obvious.
Comment #2
quicksketchComment #3
jwaxman commentedThis would be very helpful.
My most important reason for using this module is for large video files.
Using move/rename would save substantial server resources and time.
Is there another way to approach this?
Comment #4
robin_b commentedI found a solution for this, however it involved adding a function to the core. I saw no other way because it's not possible to move a file in Drupal. Everything is done with copy/delete even the core function file_move().
I use this module especially for big video files (+600MB) and half the times it crashes because it takes too long to copy the file.
I basically copied the core function file_copy() (file.inc) and named it file_real_move().
I edited this line
to:
Next, I edited the module filefield, file field_file.inc, function field_file_save_file() and added an extra function parameter named $copy_file
I also changed this part in the function:
The default value of $copy_file is TRUE, so everything that calls this function will keep functioning as before.
The last thing I did was altering file attach.inc, module filefield_sources, function filefield_source_attach_value(). I added the parameter FALSE to field_file_save_file, so the above function moves the file instead of copying it.
I provided a Drupal6 patch for this not-done way. If you apply this change, be sure to document it, so you remember it when you update the core or this module.
Comment #5
quicksketchUnfortunately I'm no longer updating the Drupal 6 version of the module. This change will need to be ported to D7. It's a good approach and patch, but for me it's not worth the effort of maintaining the D6 module any more.
Comment #6
quicksketchActually I take that back. It looks like D6 is still getting maintenance updates but no new features. As a bug, this seems like it could/should apply to both versions of the module. Unfortunately file handling changed quite a bit between D6/D7, so porting requires some work.
Comment #7
kenorb commentedDrupal 6 is no longer supported.
Comment #8
kenorb commented