1 of 3
1
Freeform Multiple File Upload Problem
Posted: 12 March 2008 12:31 PM   [ Ignore ]
Newbie
Rank
Total Posts:  11
Joined  2007-12-12

Hi,

I am trying to use the file upload to allow a job applicant to upload a resume and another misc. file.

here is my form:

{exp:freeform:form form_name="jobs" onsubmit="return validate(this);" notify="email@awesome.com" return="jobs/thank-you" send_user_email="yes" user_email_template="job-thank-you" template="job-notify" file_upload ="resumes"}
<fieldset>
<
label>First Name: </label>
<
input type="text" name="firstname" value="" /><br/>

<
label>Last Name: </label>
<
input type="text" name="lastname" value="" /><br/>

<
label>Phone Number: </label>
<
input type="text" name="phone" value="" /><br/>

<
label>Email: </label>
<
input type="text" name="email" value="" /><br/>

<
label>Applying For: </label>
<
input type="text" name="job" id="job" value="<?= $_GET['job'] ?>" readonly /><br/>

<
label>Upload Resume: </label>
<
input type="file" name="file1" value="" /><br/>

<
label>Upload Additional Attachment: </label>
<
input type="file" name="file2" value="" /><br/>

<
label>&nbsp;</label>
<
input class="submit" type="submit" name="submit" value="Submit" />
</
fieldset>
{/exp:freeform:form}

On submittal, I get this awesome error! 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@nomaco.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.0.54 Server at www.nomaco.com Port 80

I have checked the error logs and they are eerily empty....

I did some testing and spelunking and found the following:

Both files ARE making it into the resumes upload directory.
The entry IS showing up in the Freeform database.
ONLY “file1” is showing up as uploaded in the Freeform database.
On removing “file2” from the form, it works flawlessly.

Help?

Thanks!

Profile
 
 
Posted: 12 March 2008 12:42 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3342
Joined  2006-10-18

visionpoint,

Which version of Freeform, and ExpressionEngine are you using?

Can you remove the Javascript onSubmit from the form and retest? smile

onsubmit="return validate(this);"

 Signature 
Profile
 
 
Posted: 12 March 2008 12:50 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  11
Joined  2007-12-12

I removed the javascript and received the same problem.

I am running EE 1.6.0

I was running Freeform 2.5.7 when I first got this problem and I recently updated to 2.6.3 and it did not fix the problem.

Thanks!

I am doing an automatic login before the form so the file uploads will work.  I don’t know if this is helpful but here is my login form.

<form id='member_login_form' method="post" action="{site_url}" style="width: 100px;" >

<
div class='hiddenFields' style="display: none;">
<
input type="hidden" name="XID" value="d60ed23737f86ec48bb656746474334d1718a660" />
<
input type="hidden" name="ACT" value="9" />
<
input type="hidden" name="FROM" value="" />
<
input type="hidden" name="site_id" value="1" />
<
input type="hidden" name="RET" value="{site_url}jobs/apply/?job={title}" />
</
div>

<
input type="hidden" class="hidden" name="username" value="jobs" />

<
input type="hidden" class="hidden" name="password" value="jobshr" />

<
input type="image" src="{site_url}dress/apply-now.gif" style="width: 100px;" />

</
form>

It seems to function perfectly.  and it all works fine without the second file upload field. smile

Profile
 
 
Posted: 12 March 2008 03:00 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3342
Joined  2006-10-18

That’s actually pretty clever! LOL
Out of curiousity, what would happen if the person applied for another job… wouldn’t it show an error that they’re already logged in?

Now that I think of it, I guess you could go a little further and set the {if logged_out} conditional around that code, and have the {if logged_in} conditional use a regular link without logging in.... sorry for getting off topic LOL

Would I be able to see this thing in action? smile

 Signature 
Profile
 
 
Posted: 13 March 2008 07:12 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  11
Joined  2007-12-12
Pie Man - 12 March 2008 03:00 PM

That’s actually pretty clever! LOL
Out of curiousity, what would happen if the person applied for another job… wouldn’t it show an error that they’re already logged in?

Now that I think of it, I guess you could go a little further and set the {if logged_out} conditional around that code, and have the {if logged_in} conditional use a regular link without logging in.... sorry for getting off topic LOL

Would I be able to see this thing in action? smile

It seems that is just logs them in again, doesnt seem to knock an error but the conditionals you talked about would definitely make for a better user experience.

I PMed you a link to the app-thing in action smile

Profile
 
 
Posted: 13 March 2008 09:28 PM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3342
Joined  2006-10-18

Strange…

I cannot duplicate this problem on my test site… (but can on oyur website) wink

For the heck of it, try and see if this form, exactly as it is (with the exceptions of adjusting some parameter values), in a seperate, clean template… works:

{exp:freeform:form form_name="test_form" return="path_to/thank_you_page" required="name|email" notify="yourname@yoursite.com" file_upload="Main Upload Directory" template="default_template"}

<p>Name<br />
<
input type="text" name="name" value="" />
</
p>

<
p>Email<br />
<
input type="text" name="email" value="" />
</
p>

<
p><label>Upload Resume: </label>
<
input type="file" name="file1" value="" /><br/>

<
label>Upload Additional Attachment: </label>
<
input type="file" name="file2" value="" /><br/>
</
p
<
p>
<
input type="submit" name="submit" value="submit" />
</
p>

{/exp:freeform:form}

 Signature 
Profile
 
 
Posted: 14 March 2008 06:52 AM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  11
Joined  2007-12-12

{url i PMed you}/jobs/test-form

it still fails with 2 file uploads.  This is torture LOL

Are we thinking that this might be some odd server configuration issue?  It is hosted on mediatemple’s girdserver

should I try to upgrade to the latest EE build?

EDIT:

Ok I am kind of an idiot.  I thought the error logs were magically clean.... because I was checking the wrong error logs.... (kill me?)

Here is the error information being thrown.

[Fri Mar 14 07:07:31 2008] [error] [client IP_ADDRESS] Allowed memory size of 1 bytes exhausted (tried to allocate 94 bytes), referer: MY_URL/jobs/apply/?job=Systems%20Developer
[Fri Mar 14 07:07:31 2008] [error] [client IP_ADDRESS] Premature end of script headers: php4, referer: MY_URL/jobs/apply/?job=Systems%20Developer

Profile
 
 
Posted: 14 March 2008 08:38 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3342
Joined  2006-10-18

visionpoint,

It looks like your server set up is not configured to allow the upload at the memory level.

 Signature 
Profile
 
 
Posted: 14 March 2008 08:57 AM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  11
Joined  2007-12-12
Pie Man - 14 March 2008 08:38 AM

visionpoint,

It looks like your server set up is not configured to allow the upload at the memory level.

crazy that it would be kept at 1 byte smile

Profile
 
 
Posted: 14 March 2008 08:58 AM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3342
Joined  2006-10-18

Indeed wink

 Signature 
Profile
 
 
Posted: 14 March 2008 11:11 AM   [ Ignore ]   [ # 10 ]
Newbie
Rank
Total Posts:  11
Joined  2007-12-12

still doesn’t terribly explain the fact that one file works fine… >_<

I will post my results with mediatemple in case anyone else hits this error one day.

Profile
 
 
Posted: 14 March 2008 11:12 AM   [ Ignore ]   [ # 11 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3342
Joined  2006-10-18

Yes, I’d check with them to make sure the configuration is correct. smile

 Signature 
Profile
 
 
Posted: 17 March 2008 02:23 PM   [ Ignore ]   [ # 12 ]
Newbie
Rank
Total Posts:  11
Joined  2007-12-12

well mediatemple denied fault.

it worked on my other media temple account.

I then killed the upload directory and made a new one..... and it worked. >_<

hooray for unidentifiable unexplainable problems LOL

Profile
 
 
Posted: 17 March 2008 02:26 PM   [ Ignore ]   [ # 13 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3342
Joined  2006-10-18
visionpoint - 17 March 2008 02:23 PM

hooray for unidentifiable unexplainable problems LOL

Amen!

 Signature 
Profile
 
 
Posted: 08 April 2008 06:07 PM   [ Ignore ]   [ # 14 ]
Newbie
Rank
Total Posts:  5
Joined  2008-04-02

I’m having the same issues as above. Also running on Media Temple.

I REALLY need to get a fix for this problem. We’re running a user submission site (http://amplesample.net) and need the ability to upload two files ( a JPG and a PDF). I have tried the above “fixes” (ie - deleted upload directory and created new one, checked log files, etc.) but nothing seems to work.

The crazy part is, if I’m logged in as an admin it works fine, if I’m logged in as a normal user it gives me the 500 Internal when trying to upload two files. If I try to upload one file logged in as a normal user it works fine.

I have checked the ADMIN section under user management and set what I assumed should be set but with no luck.

I really need a fix for this and any help would be appreciated.

Profile
 
 
Posted: 08 April 2008 06:11 PM   [ Ignore ]   [ # 15 ]
Newbie
Rank
Total Posts:  5
Joined  2008-04-02

Also, to make sure I’ve got everything working correctly, here is my code....

{if logged_in}

{exp
:freeform:form form_name="submission" send_user_email="yes" user_email_template="user_notification" file_upload ="User Submission" notify="hello@amplesample.net" template="user_submission" return="{homepage}success" required="full_name|tryks|email|description|title"}
 
 
<label for="full_name">
  <
h3>Full Name<span class="required">*</span></h3>
  </
label>
 <
input type="text" name="full_name" value="" />

 <
label for="company_name">
  <
h3>Company Name</h3>
  </
label>
 <
input type="text" name="company_name" value="" />

 <
label for="email">
  <
h3>Email<span class="required">*</span></h3>
  </
label>
 <
input type="text" name="email" value="" />
 
 <
label for="tryks">
  <
h3>How Many Tryks Did You Use?<span class="required">*</span></h3>
  </
label>
 <
input type="text" name="tryks" value="" />

 <
label for="title">
  <
h3>Project TitleSomething Catchy Will Do.<span class="required">*</span></h3>
  </
label>
 <
input type="text" name="title" value="" />

   <
label for="description">
 <
h3>Description<span class="required">*</span></h3>
   </
label>
  <
textarea name="description" cols="50" rows="10"></textarea>

 <
label for="jpeg_file"><h2>Upload Your Image</h2></label>
 <
input type="file" name="file1" value="" />

  <
label for="pdf_file"><h2>Upload Your PDF Instructions</h2></label>
 <
input type="file" name="file2" value="" />

 <
input type="image" value="Submit" class="registration-image" alt="submit" src="(removed from example)" />

{/exp:freeform:form}

<h6>Denotes A Required Field <span class="required">*</span></h6>

{/if}

Profile
 
 
   
1 of 3
1