Skip Navigation

[Resolved] File upload field not working properly on CRED form

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 1 voice.

Last updated by J S 6 years, 7 months ago.

Author
Posts
#627739

J S
Screen Shot 2018-03-23 at 8.56.31 AM.png

I built a CRED form for a CPT with some conditional fields that display depending on what term is selected from a Custom Taxonomy select dropdown. The form seems to be working properly for all fields except the File Upload field.

My form code is as follows:

[credform class='cred-form cred-keep-original']

	[cred_field field='form_messages' value='' class='alert alert-warning']

<div class="form-group">
		<label>Submission Name OR Title (to be displayed on this site)</label>
		[cred_field field='post_title' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
	</div>
<div class="form-group">

  <label>Select Type of Submission</label>
		[cred_field field='submission-type' display='select' single_select='true' output='bootstrap']
	</div>
	
[cred_show_group if="($(submission-type) eq  '18' )"  mode='fade-slide']
<div class="form-group">
		<label>Video Link</label>
		[cred_field field='video-link' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
	</div>

	<div class="form-group">
		<label>Audio Link</label>
		[cred_field field='audio-link' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
	</div>
[/cred_show_group]

	<div class="form-group">
		<label>Description of this submission and why it is relevant</label>
	[cred_generic_field field="post_content" post="submissions"  type="textarea" class="" urlparam="" output='bootstrap']
{
"required":0,
"validate_format":0,
"persist":0,
"default":""
}
[/cred_generic_field]	
     
	</div>

      

[cred_show_group if="($(submission-type) ne  ARRAY('18','12','17','16') )"  mode='fade-slide']
	<div class="form-group">
		<label>Course Title & Number</label>
		[cred_field field='course-title' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
	</div>

	<div class="form-group">
		<label>Course Level</label>
		[cred_field field='course-level' post='submissions' value='' urlparam='' output='bootstrap']
	</div>

	<div class="form-group">
		<label>Institution</label>
		[cred_field field='institution' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
	</div>
[/cred_show_group]

[cred_show_group if="($(submission-type) ne  ARRAY('15','13','14'))"  mode='fade-slide']
	<div class="form-group">
		<label>Original Source</label>
		[cred_field field='original-source' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
	</div>
[/cred_show_group]

	<div class="form-group">
		<label>Contributor Name</label>
		[cred_field field='contributor-name' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
	</div>

    <div class="form-group">
		<label>Contributor Email</label>
		[cred_field field='contributor-email' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
	</div>


[cred_show_group if="($(submission-type) ne  '18' )"  mode='fade-slide']
	<div class="form-group">
		<label>Select files to upload to repository (Word, Excel, PowerPoint, PDF etc.)</label>
		[cred_field field='file' post='submissions' value='' urlparam='' output='bootstrap']
	</div>
[/cred_show_group]
	

	[cred_field field='form_submit' value='Submit' urlparam='' class='btn btn-primary btn-lg' output='bootstrap']

[/credform]

I have no Access restraints set on this form at the moment but even when logged in as an Admin, I cannot submit any files to the form. When a file is selected, the progress bar displays making it look as if the file is being uploaded, but then a popup message displays on the screen with the following message "The Form you submitted has expired. "Please refresh the page and try again" (see screenshot).

How do we fix this?

#627742

J S

By the way, the above problem persists regardless of whether AJAX is enabled or not. Also, the message displays as soon as the file upload progress bar completes -- meaning before the Submit button is clicked.

#627758

J S

Forcing https for entire site fixed the issue.