A recent change to File (Field) Paths was to have files uploaded to the temporary file system instead of the desired file system prior to the file being processed, which not only helps with keeping the destination file system clean, but is extremely helpful for those using external file schemes like Amazon S3 as it prevents the unprocessed file being uploaded unnecessarily. #2383527: Force unprocessed uploads to temporary://

Unfortunately, this has caused an issue with FileField Sources, specifically the Remote source and 3rd party Plupload source, but undoubtedly other sources as well. And example of the issue is as such:

When the Remote source finished transferring the file it moves the FileField Sources temporary file to it's destination and then deletes the temporary file, however in this case the temporary file and the destined file is the same, so when it deletes the temporary file it is actually deleting the real file.

The solution is simple, and a patch will be incoming; Check that the temporary file is different to the real file before deleting it.

CommentFileSizeAuthor
#2 check_file-2564593-2.patch765 bytesDeciphered
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Deciphered created an issue. See original summary.

Deciphered’s picture

Status: Active » Needs review
FileSize
765 bytes
JordanMagnuson’s picture

Status: Needs review » Reviewed & tested by the community

Tested and running on my live site.

quicksketch’s picture

I'm not quite following here. File Field Sources uploads into the temporary:// file scheme. How would the temporary file be the same as the final destination? Or are you saying that saving to the s3:// scheme doesn't actually move the file at all, it stays in the same location?

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

Well, upon testing I don't see any danger in this check. So although I don't fully understand the situation it doesn't seem to do harm. I've merged this into 7.x-1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.