Emails not sending when file attached

My campaigns stopped sending altogether last week. I queried with my hosting provider who requested I update the cronjob with /usr/bin/php so the cronjob is now:
/usr/bin/php -c /usr/www/httpd/php5-ini/USERNAME/php.ini /usr/www/users/USERNAME/lists/admin/index.php -pprocessqueue -c /usr/www/users/USERNAME/lists/config/config.php
It now sends campaigns unless there are attachments which is required for the use of my campaigns. It returns the message:
Error, when trying to send campaign [number] the attachment ([file name])
could not be found in the repository

Is there a reason the system cannot locate the attached file and is there a solution to fix this?

Thanks in advance for your assistance.

@Phatwozza Sometimes this is a permissions problem. Ensure that the cron job runs as the same user as the web server. On a shared hosting server that is usually the case but possibly the cron job is being run as a different user.

Hi @duncanc. Thanks for the response. My hosting provider would like to know where the attachments are being stored to see if there might be a permission problem in trying to access the file. Do you know?

@Phatwozza You should have set the attachment directory in your config.php file. But if you have not done that then I think it defaults to the system /tmp directory, so it is quite possible for attachments to “disappear”.

It was a while ago but I doubt I set it up. I’ll do a search to find instructions but if you have any links I’d appreciate the direction. Thanks as always for your assistance @duncanc

Ensure the following ocode is in your lists/config/config.php file.

# the attachment repository is the place where the files are stored (if you use
# ALLOW_ATTACHMENTS)
# this needs to be writable to your webserver user
# it also needs to be a full path, not a relative one
# for secutiry reasons it is best if this directory is not public (ie below
# your website document root)
$attachment_repository = '/tmp';