• Hello,

    I am using this contact form for a form with an attachment,
    It worked pretty well locally,

    however, my form is not sending anymore the attachement,

    I get my email, with the attachement name, it’s uploaded in the CF7 folder but there is no attachement in the mail …
    there is the [file-#] in the left attachment space…

    Do you have any idea about what could be wrong ?

Viewing 15 replies - 1 through 15 (of 18 total)
  • i’m looking for the same answer right now. went through the author’s tutorial (https://contactform7.com/blog/2009/11/24/file-uploading-and-attachment/) but still not getting attachments

    I have the exact same issue… It appears my attachment are in the upload folder, but they do not appear in the email I receive.

    From what I could see, the FTP settings WordPress is using is different then what the plugin uses: the users are not the same if I check it in the FTP.

    Perhaps that is the cause… I’m currently testing out something: creating the folder manually under the “user” from the FTP, and configuring the plugin to dump stuff in this folder…

    From what I could see, the folder I created successfully receive the files, and those files have the following CHMOD: 400, under a user group different from the one that the FTP uses (I guess that’s the way the server is setup).

    So I have the same issue, my uploaded file don’t find their way to the email itself and are not sent.

    Thread Starter Oriman

    (@oriman)

    Yep, I have seen that.
    I tried to build this folder manualy too before I asked …

    Does someone have an answer for this, I guess, small bug ?

    @Nikolabs, If you find a way, keep me posted please.

    Thanks !

    Nope… I’m stuck like you guys.

    The problem is that I’m using this plugin for Jobs offerings, and people can’t upload their CV… I’ll have to manually get those from the folder and forward the email to the client, along with the CV…

    Weird thing is that I’m using the plugin on another website infrastructure with uploads and all just fine.

    I’m guessing that the plugin simply ignores the “FTP_HOST”, “FTP_USER”, “FTP_PASS” settings in the wp-config.php file.

    I hope this get fixed quickly.

    Thread Starter Oriman

    (@oriman)

    The same…
    I am using it on some other websites without any problem,

    Do you think we can do something to fix it ?

    I hope it will be fixed soon too …

    i have seen the author of this plugin (Takayuki Miyoshi) responding to some other threads so with any luck he will jump in here and have some advice for us

    one thing that you guys are saying that i am confused about though. you’re saying that the files are being stored in the upload folder where you can retrieve. mine are not being stored, and according to the tutorial in the URL i posted above, it says ..

    “Contact Form 7 moves the uploaded file to a temporary folder. At this point, Contact Form 7 attaches the file to the mail and sends it. After these procedures, Contact Form 7 then removes the file from the temporary folder.”

    in my folder the files are not present, which i thought is normal according to the above. wondering how come you all are able to retrieve the files from the upload folder

    Thread Starter Oriman

    (@oriman)

    Hi mike,

    I don’t know for your folder if the file are coming in then beeing deleted or not coming in ?

    I guess they are not coming or it’s not the same trouble as mine, if so, check again if you correctly enter [file-#] inside the “attachment” field bellow the code of the form.

    PS : # should be the same number as you get on your mail form and on your contact form

    Indeed, the plugin normally delete the files in the temporary folder (default “wpcf7_uploads”).

    Thos problems are related: CF7 cannot delete the files, since they are under another ftp owner/group, hence it cannot place them as email attachment either.

    The thing is, I don’t know why CF7 wouldn’t uploads those files under the same owner/group as WordPress itself, or using the FTP_USER in wp-config.php…

    I tried the following:

    I disabled the deletion of the file (see modules/file.php ~ line 340);
    I also changed the CHMOD call so it sets the file permission to 0775 instead of 0400 (see modules/file.php ~ line 188);
    I even added a @chown call under it to hardcode my owner directly…

    I did another test, to check if the chmod was working: I created a temp php file simply calling the following:

    ini_set('display_errors',1);
    error_reporting(E_ALL);
    
    $filename = '/ABSOLUTE/SERVER/PATH/public_html/wp-content/uploads/wpcf7_uploads/MyTARGETFILE.pdf';
    
    chown($filename, 'MyUSER');
    chmod($filename, 0775);

    No success, file uploaded are still under the owner/group “nobody” in my FTP and I cannot download them or delete them and chmod/chown do not have any effect (I’ll contact the webhost about that).

    My issue here is that the PHP running WordPress as a CMS doesn’t have root access, since the client’s website is in a shared environment.

    Any ideas? I’m stuck with a bug on a live website and it’s tiring on my nerve…

    Thread Starter Oriman

    (@oriman)

    You tried hard !
    I didn’t find a way to fix it too…
    I hope to have time this week to look at it carefully.
    Where is the developper ?!
    I hope this form will be fixed soon …

    haha, not much choice… The thing is live and I need that fixed asap.

    It does seems to me the webhost is the cause behind this, but I assume I’m not the only person with a client under a strict shared environment, so the bug might occurs for others… others who won’t post here to tell about it and simply delete the whole plugin instead and go for another solution (Gravity Forms and Wufoo comes to mind).

    I’m in the process of upgrading the server to PHP 5 (at least, I made the resquest, the server was still in PHP 4.4.2), and that may be the issue here… hopefully.

    I’ll keep you guys posted… If anyone comes up with a fix, reply here too, I’ll be notified by email.

    I must concur that Contact Form 7 seems hopelessly broken when it comes to attachments. My setup includes WP 3.1, CF7, and 1and1.com linux hosting (have tested it with both PHP 4 and 5). Despite hours of testing, I have never once received an email with a file attachment. All I have been able to do is affect the way that uploaded files are stored. Depending on the permissions I set for the upload folder CF7 either:

    1. Wipes the upload directory clean before each set of attachments is uploaded.
    2. Accumulates uploaded files in the upload directory (adding “1”, “2”, to duplicate filemanes)

    CF7 needs a serious fix- attachment files should be both reliably emailed and permanently stored in automatically generated subfolders.

    Just for your information this plugin seems to have fixed all my issues with CF7 uploads/attachments.

    https://www.ads-software.com/extend/plugins/contact-form-7-to-database-extension/

    After activating this plug I started receiving email attachments for the very first time.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Plugin: Contact Form 7] Attachment not sent but in the upload folder’ is closed to new replies.