I have a configuration that uploads files to s3. Suppose I opt to "delete source from local server" after file is stored on s3.
If a second file is uploaded with same name ('abc.flv') as a previously uploaded file, then this second file does not get renamed to 'abc_0.flv' (because 'abc.flv' no longer resides on the local server), and media_mover does not process this second file.
To fix the problem, I modified mm_s3_send() so that rather than deleting the source-file, it replaces the source-file with a 0-byte file. This way, when the second file is uploaded, it gets renamed to 'abc_0.flv'.
function mm_s3_send($file, $configuration, $verb, $action_id) {
...
foreach (array_unique($delete_files) as $delete_file) {
watchdog('MM S3', 'Deleted local file: !file', array('!file' => $delete_file));
unlink($delete_file);
touch($delete_file); // <--- this is the line I added
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| mm_s3.bug21.diff | 38 bytes | kobnim |