Putting enctype prevents email from being sent

Shows some Tutorials

Putting enctype prevents email from being sent

Postby brewster on Mon Jan 14, 2008 10:23 pm

I have a file upload form and when I put enctype='multipart/form-data' in the general tab in Form tag attachment as suggested I then no longer get the notification email that a file has been uploaded. However, if I go into the upload directory, I see that the file has been uploaded successfully.

On the other hand if I take out that code, I then get the notification email but then the file no longer uploads.

This seems to be a bit of a catch 22. Any suggestions?
brewster
Fresh Boarder
 
Posts: 18
Joined: Mon Jan 14, 2008 3:13 pm

Re:Putting enctype prevents email from being sent

Postby GreyHead on Mon Jan 14, 2008 10:30 pm

Hi brewster,

The two shouldn't be linked at all, the code that deals with each is pretty much completely separate.

Please take a Form Backup in the CF Form Manager and post it here or email it to me at the address in my sig and I'll take a look.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3253
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Putting enctype prevents email from being sent

Postby brewster on Mon Jan 14, 2008 11:34 pm

ok, I emailed you the backup.
brewster
Fresh Boarder
 
Posts: 18
Joined: Mon Jan 14, 2008 3:13 pm

Re:Putting enctype prevents email from being sent

Postby GreyHead on Mon Jan 14, 2008 11:55 pm

Hi brewster,

You need to have a value in the Minimum size field on the File uploads tab - please try 1 and see if that makes the difference.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3253
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Putting enctype prevents email from being sent

Postby brewster on Tue Jan 15, 2008 12:22 am

I just tried that and it didn't make a difference. I am thinking I should try creating a new form and see what happens.
brewster
Fresh Boarder
 
Posts: 18
Joined: Mon Jan 14, 2008 3:13 pm

Re:Putting enctype prevents email from being sent

Postby GreyHead on Tue Jan 15, 2008 12:35 am

Hi brewster,

It's working OK for me here. I've restored your file; put 1 in the min field; changed the email address to my own (you'll get the first couple though); temporarily removed the redirect URL; and turned debug on. Otherwise I'm using your code as is.

Bob

PS I notice that there are two 'name =' entries in the file input tag, probably isn't causing this problem but might give ChronoForms indigestion.
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3253
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Putting enctype prevents email from being sent

Postby brewster on Tue Jan 15, 2008 1:34 am

I created a new form from scratch and with debug on, I get the message "Email not sent". I am wondering if there is an issue with our server and the enctype?
brewster
Fresh Boarder
 
Posts: 18
Joined: Mon Jan 14, 2008 3:13 pm

Re:Putting enctype prevents email from being sent

Postby brewster on Tue Jan 15, 2008 2:01 am

Doing a Google search of enctype='multipart/form-data' and enctype='multipart/form-data' php indeed brings up several results of people having this same problem i am on a remote server. I noticed your ip was 192.168 etc.. so that could explain why yours works with my script. I have contacted Rackspace our colo host to see what they have to say about it.
brewster
Fresh Boarder
 
Posts: 18
Joined: Mon Jan 14, 2008 3:13 pm

Re:Putting enctype prevents email from being sent

Postby GreyHead on Tue Jan 15, 2008 5:36 am

Hi brewster,

My server Apache on another machine on the network here so it's semi-remote. We've seen plenty of examples where on-line form file upload works so I guess you've hit some configuration issue with Rackspace. Good luck with getting it resolved.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3253
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Putting enctype prevents email from being sent

Postby brewster on Tue Jan 15, 2008 7:09 am

rackspace answered back and said this:

"When you use enctype="multipart/form-data" you cannot access the form parameters. You have to construct a query string and append it to the action before submitting (a onclick event to the submit or button0."

Does that make any sense to you?
brewster
Fresh Boarder
 
Posts: 18
Joined: Mon Jan 14, 2008 3:13 pm

Re:Putting enctype prevents email from being sent

Postby dniezby on Tue Jan 22, 2008 11:52 pm

Did you ever figure this out? I have the same problem with my forms.
Dave Niezabitowski
Nightshade Studios, CEO
dniezby
Junior Boarder
 
Posts: 25
Joined: Mon Jan 21, 2008 2:25 am

Re:Putting enctype prevents email from being sent

Postby brewster on Wed Jan 23, 2008 12:02 am

dniezby wrote:Did you ever figure this out? I have the same problem with my forms.

No I am going to have our PHP guy look at it today or tomorrow
brewster
Fresh Boarder
 
Posts: 18
Joined: Mon Jan 14, 2008 3:13 pm

Re:Putting enctype prevents email from being sent

Postby GreyHead on Wed Jan 23, 2008 1:37 am

Hi brewster,

I had a Google around this morning and found various things about setting the max_file_size in different places and ways and some about losing the $_POST entries but nothing that was very clear I'm afraid.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3253
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Putting enctype prevents email from being sent

Postby brewster on Wed Jan 23, 2008 1:52 am

Here are some similar problems: bugs.php.net
marc.info
usenet-forums
gidforums

All these people are having the same problem i am and one even says if worked fine on local server but not remote.

I searched Google for this: enctype= multipart/form-data php

Also -- Our Joomla is running on PHP 5.2.5

Edited to add url tags<br><br>Post edited by: GreyHead, at: 2008/01/23 18:03
brewster
Fresh Boarder
 
Posts: 18
Joined: Mon Jan 14, 2008 3:13 pm

Re:Putting enctype prevents email from being sent

Postby GreyHead on Wed Jan 23, 2008 11:08 pm

Hi brewster,

Like you I found plenty of references to the problem and precious few clear explanations or fixes.

It seems to me that there are several different problems intertwined here:
  • Sometimes there is a problem with the file size permitted for uploads, there are several ways of setting this and where and when it is done can make a difference
  • Sometimes switching encoding to 'multi=part/form-data' causes problems - the main symptom seems to be that the $_POST array is returned empty.
  • sometimes there is a problem with the form syntax or coding (or with supporting Javascript) that stops the form working correctly.
  • Sometimes the form works correctly but there are problems with saving the uploaded file (or emailing it).
What I'm learning is that it's really difficult to tease these apart without good debug access (and not necessarily simple even them).

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3253
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Next

Return to ChronoForms How To

Who is online

Users browsing this forum: No registered users and 2 guests