Title: Erratic attachments
Last modified: May 17, 2019

---

# Erratic attachments

 *  [André Brückner](https://wordpress.org/support/users/a4b7/)
 * (@a4b7)
 * [7 years ago](https://wordpress.org/support/topic/erratic-attachments/)
 * I have a setup with Email-Before-Download and Contact-Form-7. Everything works
   fine except that some files do not show up as attachment. About 4 out of 16 files
   are affected.
 * Through comparison and renaming I excluded as possible cause:
    – file size – 
   file type (all pdf) – special characters in filename – length of filename
 * Any ideas about the cause and how to further debug this?
    Thx, André
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferratic-attachments%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [André Brückner](https://wordpress.org/support/users/a4b7/)
 * (@a4b7)
 * [7 years ago](https://wordpress.org/support/topic/erratic-attachments/#post-11542401)
 * Another insight: when logging the outgoing mails with plugin WP Mail Logging 
   [https://wordpress.org/plugins/wp-mail-logging/](https://wordpress.org/plugins/wp-mail-logging/)
   I can see that in case of an error the attachment is tried to be read from a 
   wrong location:
 * /dlm_uploads/1970/01/myfile.pdf
 * instead of where it is really saved:
 * /dlm_uploads/2019/05/myfile.pdf
 * Some fallback to the beginning of unix calculation of times at work, I guess.
 *  Thread Starter [André Brückner](https://wordpress.org/support/users/a4b7/)
 * (@a4b7)
 * [7 years ago](https://wordpress.org/support/topic/erratic-attachments/#post-11542684)
 * Getting closer: there is a line `$fileDate = date('Y/m', strtotime($fileDate));`
   converting a date string to a part of file path.
 * Printed the variable before and after, and from the debug.log I can see:
 * 16. Mai 2019 converts to 1970/01
    13. September 2018 converts to 2018/09
 * Both date strings are German, but the second one is identical to English. So 
   the date strings that are different in German cause the error.
 *  Thread Starter [André Brückner](https://wordpress.org/support/users/a4b7/)
 * (@a4b7)
 * [7 years ago](https://wordpress.org/support/topic/erratic-attachments/#post-11543577)
 * The php function only accepts english date strings, see [https://www.php.net/manual/en/function.strtotime.php](https://www.php.net/manual/en/function.strtotime.php)
 * Thank you, plugin developers.
 * Don’t ask for my workaround. It’s ugly. It works. Still thinking about a proper
   fix.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Erratic attachments’ is closed to new replies.

 * ![](https://ps.w.org/email-before-download/assets/icon-256x256.jpg?rev=1813522)
 * [Email Before Download](https://wordpress.org/plugins/email-before-download/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/email-before-download/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/email-before-download/)
 * [Active Topics](https://wordpress.org/support/plugin/email-before-download/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/email-before-download/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/email-before-download/reviews/)

## Tags

 * [attachment](https://wordpress.org/support/topic-tag/attachment/)

 * 3 replies
 * 1 participant
 * Last reply from: [André Brückner](https://wordpress.org/support/users/a4b7/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/erratic-attachments/#post-11543577)
 * Status: not resolved