The docs for $dest should specify it must be a Drupal writeable files directory. I have been trying to pass it a path in Linux outside of web root, not knowing this would not work. Only when I tracked through the functions called (file_move() calls file_copy() which calls file_check_path() which requires that the path to be checked is in the files dir).

The same bug applies to file_copy()

CommentFileSizeAuthor
#2 590088b-D6.patch4.17 KBjhodgdon
#1 590088-D6.patch4.18 KBjhodgdon

Comments

jhodgdon’s picture

Status: Active » Needs review
StatusFileSize
new4.18 KB

This appears to be a Drupal 6 only doc issue, since in Drupal 7 the doc states that $destination must be a Drupal stream wrapper.

Here's a patch to fix the doc up for Drupal 6. General cleanup of doc of these two functions, as well as fixing the problem identified above.

Just a note: the destination can also be in the temp directory as well as files.

jhodgdon’s picture

StatusFileSize
new4.17 KB

Sorry, there was a typo in that patch. Try this one instead.

jhodgdon’s picture

Status: Needs review » Closed (duplicate)

This must have been fixed in another issue.