Is file attachment working on your site?

Hi, if you are using Contact Form 7 plugin and its file uploading and attachment feature, could you help me solve a problem?

Since I released Contact Form 7 1.9 with the feature, I’ve received some trouble reports that says file uploading isn’t working on their site. However, when I tested it on my site and it worked correctly. I think some kind of condition of their server environment could cause such troubles, but I have no clue to detect the condition for now.

So, if you have some time, please answer surveys below.

And also, please write a comment to this post about the detailed information of your environment. What version of WordPress and Contact Form 7 are you using? What tag did you enter into the form field and the mail attachment field? Are you using hosting service? If so, which one are you using? (e.g. Blue Host, DreamHost and like those) Any information would be much appreciated.

99 thoughts on “Is file attachment working on your site?

  1. One problem I had was my test attachment was bigger than the limit I was allowing. I was attaching a 2MB file but only was allowing 1MB max. Once I upped my max limit to 4MB everything worked great.

  2. Andrew, Yes, I really think so. Better documentation is needed. But, unfortunately, I have no time for writing anymore. I’m very very busy in these months!

    I think it would be nice if someone takes time to write documentation. If you could, I can link to it. Thanks for comment.

  3. I’ve tried it a few times.. I still haven’t had it work yet. It’s not in my spam folder. I guess I’m going to have to take a closer look on my own.

  4. wordpress: 2.7
    contact form 7 1.9.3
    [file attach filetypes:doc|rtf|txt|pdf|xls|jpg|ppt|pps]
    i can send an email with file, but i received an email, without attach file.
    now is in use without file upload, however for this site would be good!

    Thank you!

    Form really in use:
    Nome*
    [text* your-name]

    E-mail*
    [email* your-email]

    Telefono
    [text Telefono]

    Data di consegna (orientativa)
    [text dataorientativa]

    Tipo di Testo [select tipotesto “” “Tecnico” “Commerciale” “Letterario” “Cinema/TV” “Sito Web” “Altre lingue”]

    Oggetto
    [text your-subject]

    Il tuo messaggio
    [textarea your-message]

    [captchac antispam size:m fg:#000000 bg:#FF7F50][captchar antispam]

    [submit “Invia”]

  5. We are running WordPress 2.7.1 and Contact 1.9.3

    Here is my upload configuration:

    [file upload limit:5000000 filetypes:doc|pdf|txt|jpg|gif|png|zip]

    FIle uploads just fine – however, when message arrives, file is not attached.

    Not sure where the file is going to. I’ve searched my entire WordPress directory/sub-folder structure and did not find the files in question. So I’m not sure where/how they are supposed to be getting attached to the email.

    Hope this helps.

  6. Just tried changing the settings to this:

    [file upload]

    Uploaded/sent a jpg file… email came through – no attachment.

    I now have a wpcf7_uploads directory located in ../wp-content/uploads/

    ../sp-content/uploads has chmod of 755

    ../wpcf7_uploads has chmod of 733 – no read access for group and world.

    Tried sending jpg again…

    Never saw file enter wpcd7_uploads directory…

    Can’t manually change perms on wpcd7 directory…

    Email arrived – no attachment…

    Manually removed wpcd7_uploads dir…

    Manually created wprd7_uploads dir

    Manually applied chmod 777

    Sent jpg again… Waiting to see if message arrives… been over 5 minutes already and nothing…

  7. wp: 2.7
    contact form: 7.1.9.3

    i can send form and reciecve email but no attachment.

    Your Name (required)
    [text* your-name]

    Your Email (required)
    [email* your-email]

    Subject
    [text your-subject]

    Your Message
    [textarea your-message]

    Attach image here
    [file file-314]

    [submit “Send”]

  8. Is there any possibility to attach a .mov, .flv or any other format in the Contact Form?

    By the way, the upload is correctly working

    thxs

  9. wordpress 2.7.1
    contact 7 1.9.3

    I finally get it to work, my problem is directory permission problem, pls make sure the wp-content/uploads/ directory is writable by the apache user, chmod to 775 and chown the apache user, (e.g. apache:nogroup)

    Hope this help.

    Wai-lun

  10. What version of WordPress and Contact Form 7 are you using?
    WP v2.7.1
    CF 7 v 1.9.3

    What tag did you enter into the form field and the mail attachment field?

    Upload a file: [file file-322 limit:4000000]

    Are you using hosting service? If so, which one are you using? Blue Host

    The email is sent but without an attachment

  11. I am using A Small Orange hosting with WordPress 2.7.1.

    In my form it’s like this: [file* your-file filetypes:gif|png|jpg|jpeg]</

    My attachment field looks like this: [your-file]

    The form is in a post, not a page.

    The error I get is failed to upload, and then also a verification error (presumably since it’s a required field).

  12. Hi,
    I’m using CF7 Version 1.9.4 and WP 2.7.1.
    The Contact Form 7 is really a great plugin, but I’m also experiencing problems with the upload function. Just today I spent almost 3 hours with my ISP to solve this problem: after exactly 3 minutes I get a timeout (blank window in FF, http500 error and white window in IE) when I upload bigger files. I already adapted the .htaccess file:
    php_value upload_max_filesize 25M
    php_value post_max_size 25M
    php_value max_execution_time 1800
    php_value max_input_time 1800
    and according to my ISP this all works fine and it is not a web server problem. The configuration for the upload in CF7 is:
    [file bilderupload limit:20971520 filetypes:jpg|jpeg]
    I’m a little desperate at the moment because I would need this function quite urgently and don’t have the slightest clue where this time limit is coming from and where I can fix this. Any ideas?
    Best regards
    Kirsten

  13. Environment: PHP 5.2.x
    Version of WordPress: 2.7.1
    Version of Contact Form 7: 1.9.4
    Tag entered into the form field: [file* file-788 filetypes:.doc|.txt|.rtf]
    Tag entered into the mail attachment field: [file-788]
    Hosting service? Private Server, Dreamhost.

  14. Finally got this to work! I wanted to allow users to upload more than one attached photo with captions assigned to each one. Here is what it looks like in the form field for two:

    Image #1
    [file your-file]

    Caption #1
    [textarea textarea-93]

    Image #2
    [file your-file2]

    Caption #2
    [textarea textarea-280]

    And here’s what it looks like in the message body field:

    Caption 1
    [textarea-93]

    Caption 2
    [textarea-280]

    Note that the attachments are in the “File Attachments” field under Mail. Here’s how they’re represented:

    [your-file] [your-file2]

    And that works!

    Here’s where I’m playing around with it: http://hardtimes.firstpersonarts.org under Submit your photographs.

  15. Hi!

    My file upload form wasn’t working, and as I dug around for the problem, I noticed the $_FILES php array was empty when I tried uploading anything. I found that the form MUST HAVE the enctype=”multipart/form-data” attribute on some strict-settings servers in order to let php fill the $_FILES array.

    The simplest solution was to add a line in my jQuery startup function:

    $(‘.wpcf7-form’).attr(‘enctype’,’multipart/form-data’);

    Really hope this helps all the frustrated users of Contact Form 7, like I was 5 minutes ago.

    Cheers!

  16. Viorel, I found a bug which might cause the problem you were seeing. When you use file* typed tag, the enctype is not set correctly. When you use normal file typed tag, it’s ok. I’ve fixed it on the development version. Sorry for this inconvenience and thank you for reporting!

  17. We appreciate this plugin greatly and thank you for it, but get this upload problem fixed immediately. Our website heavily counts on this feature. It was working in the previous version, now I must revert back to that previous version until an corrected version is released.

  18. How many people are using Mailpress and having this problem? I found a huge problem. The reason my attachment is not being sent with an email is because I have Mailpress plugin on my WordPress setup. There is a CONFLICT with Mailpress and Contact Form 7! I deactivated my Mailpress plugin and the attachment sent just fine. What can be done about this and get resolved? Mailpress is STOPPING attachments from being sent and delivered to email!

  19. Tried each an every possibility to make it work. NEVER works with file attachments.

    All the permissions are well set and each folder is right on its place. Headed up with all the options mentioned above and am frustrated now. Can anyone suggest a workable solution?

    Thanks

  20. I just installed the plugin to try the attachment and it’s not working.

    What I’ve done was create attachment:
    [file file-200 filetypes:jpg|jpeg]

    Copied that to the form on the left.

    Added: [your-file][your-file2] to the form beneath it and Save.

    Refreshed the page with the form and tried sending. But keeps returning the errors:

    1. Failed to upload file.

    2. Validation errors occurred. Please confirm the fields and submit it again.

    Using WordPress 2.7.1/

  21. Top plug in – all working fine. a couple of ‘problems’ slowed me down.
    1. I didn’t see any refer to the | pipe to separate while generating the file send tag. I used , which were stripped out. A tip in ‘Acceptable file types (optional)’ would have avoided that.
    2. I didn’t find the note to include the file name in the mail box until I read your docs. again, a tip/reminder in the tag generator box might save that delay.

    What a great plugin!

    Many thanks

    Regards

    Nick

  22. i tried to use the upload tag on one of my sites.. and, it didn’t work. tried an other server and it worked perfectly. unfortunatly i dont have a clue what the problem could be. if ill find out ill let you guys know!!

  23. Hello Guyes,

    Here i am again, as promised. I solved my problem by checking the upload path. This should be wp-content/uploads (by default) if you have changed this for some reason, the script will not work. You can A: change it back to default. Or B: make al writable ‘wpcf7_uploads’ dir in your self chosen upload dir.

  24. Herr, not many of us have changed the upload directory and it still does not work. BTW, changing “wpcf7_uploads” to all writable permissions does not work either. Also, are you testing this with Mailpress and getting it to work? I can get it to work when Mailpress is deactivated, but when Mailpress is activated, the uploads stop working. So there is some sort of annoying plugin conflict happening here. I still cannot figure it out and tried all solutions. No go.

  25. Just to help a bit here, as I was in the same problem with a fresh install.

    The main problem is that the “wpcf7_uploads” folder that its created is under apache owner / group and it needs to be under your account owner / group.

    If you change the owner group to you and chmod 777, it works perfectly.

    Hope someone gets this usefull.

  26. For anyone still having trouble with this, I was missing the ‘wpcf7_uploads’ directory in wp-contents/uploads/. as soon as I created it and set the permissions to 777, the attachments worked perfectly!

  27. I have that directory at Bluehost and still have the problem. Just attached a basic upload option, and tried to send it along with the email.

    [file onetwo]

    -Jim

  28. Has anybody found an answer to this issue yet? Two CF7 version upgrades since this conflict and still no fix. This is ridiculous.

  29. Well, for those who may be struggling with this as I have. I created a temporary fix that might greatly help those that cannot get included attachments in their emails (temporarily until a fix by the author is provided)…it’s far from perfect but this option will keep the system from deleting the file in the uploaded section so you can obtain it straight from the directory.

    1. First start with the plugin’s upload.php page. (contact-form-7/includes/)

    -Go to your uploads/wpcf7_uploads directory and remove the “deny all” line from your htaccess file and save. Make sure this directory is 777. Some people reported not having this directory…If this directory does not exist, create it (as you will need for step 2 below).
    -In upload.php find the 733 chmod issue and change to 777.
    -Remove the htaccess_file deny code from around line 237. Save and upload.

    2. Then go to functions.php (contact-form-7/includes/)

    -Find the directory code /uploads around line 71 and change to /uploads/wpcf7_uploads…do the same for around line 87. Save and upload.

    3. Finally, go to wp-contact-form-7.php (in the main contact-form-7 directory)

    -Look for // remove upload files note around line 445…remove this entire action through line 451…do the same for lines around 524 to 530. This includes the ending bracket } belonging to these actions only, but be careful to go no further, you don’t want to delete all of them). Save and upload.

    Now when a user submits an uploaded file it will save to that directory without removing itself. It’s not perfect but it does save the file and can be accessible by either the full directory or FTP. It’s best to put a checkbox in your form saying “File Included” so you know if the user is uploading a file with their submission.

  30. I forgot to mention, make sure to also change the 60 second timeout on contact-form-7/includes/upload.php page (near bottom of page) to something like 800000 or even a million seconds. That’s around 8-12 days before it auto deletes the file. Go longer if you have to. :)

  31. Hey Tim – Nice name BTW :-), did you ever work out a more robust fix?

    I’ve noticed that the Upload.php functionality is now included in modules/file.php and I’ve made all your changes and still the attachments don’t arrive in my emails – although they are uploaded to the dir.

    Frustrating. There really should be a way to add an attachment with Mailpress running.

  32. Hey Tim,

    Yes good name! No I still haven’t found a fix other than the one I posted. They do not arrive by email but at least they drive their way to the directory and as long as we can get that to work, we can grab the attachment. In the form I created, I have a check box that asks if the submitter will be sending a file, then I just match up the date and info with the file in the directory to know it was from that submitter. It’s a pain in the ass but it works for now. We’re running it on a school site so we need to keep the mailpress running, otherwise I’d disable that and let Contact Form 7 do its thing. Hopefully in the near future something will get resolved. :)

  33. I’ve tried many of the suggestions on this site and I can’t get this upload function to work properly. I am using WordPress 2.8.4. and contact form version Version 2.0.1. My host is Host Gator. I’ve set folder permissions to 777, removed any restrictions in my ht access file. The form works, but there is no attachemnt included in the email. I wonder if its getting removed at the server level? Here are my form settings

    Your Name (required)
    [text* your-name]

    Your Email (required)
    [email* your-email]

    Subject (required)
    [text* your-subject]

    Your Message (required)
    [textarea* your-message]

    Attach a file
    [file your-file]

    [submit “Send”]

  34. I am running the most current version of wordpress (2.8.4) and everything is working fine except for the file upload. Ay help would be appreciated.

    Thanks,
    Chris

  35. Just don´t send files, says it can´t send the file and the yellow warning says Validations Error etc.

    Without files it´s works fine.

    I would like to know the system requirements for this plugin. I just can´t find it! I´m using a free host service but full working, the lastest php, etc.

  36. Roshan, are you running Mailpress as well? It works perfect on my site as well, but with Mailpress activated IT IS NOT.

  37. I am getting the following error message. Anyone run into this? Validation errors occurred. Please confirm the fields and submit it again.

  38. Face value – looks a good plugin – and for free, In practice, just like a lot of others – tested in isolation and not the real world. It ain’t workin’ here either (with attachments). Silence from the author!? I’m looking for another contact form, and prepared to pay for a professional and tested plug-in.

  39. One thousand apologies. Attachments ARE working on my site, and it was all my fault! I included the leading slash before the temporary upload directory – it just took me some frustrating time to find it and fix it. So sorry for the earlier ‘flamer’. Good work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s