in reply to tar a files from loop
print $? if $?; [download]
Another quick thing to try is to replace the tilde with a full path:
`tar -xf $tarfile -C /home/foo/path_to_dir`; [download]
See also: What's wrong with using backticks in a void context?