diff --git a/include/class.file.php b/include/class.file.php
index 9c8eb9c53da2a4c450421c4e8261c1efcc511311..ac87b0c80858cc0fe5318dcd78713964d76e04dc 100644
--- a/include/class.file.php
+++ b/include/class.file.php
@@ -386,7 +386,7 @@ class AttachmentFile {
         $after = hash_init('sha1');
 
         // Copy the file to the new backend and hash the contents
-        $target = AttachmentStorageBackend::lookup($bk, $this->ht);
+        $target = FileStorageBackend::lookup($bk, $this);
         $source = $this->open();
         // TODO: Make this resumable so that if the file cannot be migrated
         //      in the max_execution_time, the migration can be continued
@@ -398,7 +398,7 @@ class AttachmentFile {
 
         // Verify that the hash of the target file matches the hash of the
         // source file
-        $target = AttachmentStorageBackend::lookup($bk, $this->ht);
+        $target = FileStorageBackend::lookup($bk, $this);
         while ($block = $target->read())
             hash_update($after, $block);