Hi,
I know that ths plugin is no longer supported, but i am desperately trying to find out a way to achieve the following:
I would like for the files that will be uploaded in a form submission, to be uploaded in a different folder each time a form is to be submitted.
The entry ID would be the ideal folder name for each submission.
Did anyone manage to achieve this or anything similar?
Please note that the users will be non-logged in users.
Thank you so much in advance!
]]>I’d like to upload each form entry’s attachments to their own folder. The name of the folder would be the {entry_id}. Is this possible?
Thank you.
]]>Hello,
I’m using the AJAX upload fields on a complex multi-page form. When loading the page, I get a pop-up error upon first clicking on the page. It says:
Error: Script error.
URL:
Line Number: 0
Do you have any ideas what could be causing this?
]]>I realise this plugin has been abandoned and these forums no longer moderated, but if anyone can tell me how to remove the column names when viewing the post I’d appreciate it.
]]>Steps to reproduce the issue:
In 2.8.0, I received 500 errors when uploading a jpeg that had high-resolution (E.g. 4032?×?3024). Thumbnail settings and data (MB) size didn’t seem to matter.
Resolution:
I set the “Reduce Image Width (and Height)” options to 2000. Afterwards images uploaded successfully.
I didn’t troubleshoot this further, but I wanted to report this to hopefully help others. Thanks!
]]>Here is a patch to add an optional feature (disabled by default) to hide uploaded file links on the front end for installations that don’t allow unauthorized file downloads. Essentially, it removes the link to the file from the ajax progress bar after upload, and only displays the file name.
diff --git a/gravity-forms-ajax-upload-addon.php b/gravity-forms-ajax-upload-addon.php
index 4c004c6..43aa9c4 100644
--- a/gravity-forms-ajax-upload-addon.php
+++ b/gravity-forms-ajax-upload-addon.php
@@ -166,6 +166,19 @@ if ( class_exists( 'GFForms' ) ) {
'default_value' => true
)
)
+ ),
+ array(
+ 'label' => __( 'Hide uploaded file link', 'ajax-upload-for-gravity-forms' ),
+ 'type' => 'checkbox',
+ 'name' => 'hide_uploaded_file_link',
+ 'tooltip' => __( 'This option allows you to control whether the link to the uploaded file is exposed to the form user.', 'ajax-upload-for-gravity-forms' ),
+ 'choices' => array(
+ array(
+ 'label' => __( 'Yes', 'ajax-upload-for-gravity-forms' ),
+ 'name' => 'hide_uploaded_file_link',
+ 'default_value' => false
+ )
+ )
)
)
),
@@ -540,6 +553,7 @@ if ( class_exists( 'GFForms' ) ) {
'apostrophe_error_enable' => rgar( $ajax_upload_options, 'apostrophe_error_enable' ),
'text_apostrophe_error_message' => esc_js( __( "Error: file name contains an apostrophe/quote (‘). Remove apostrophe/quote (‘) from file name and try again.", 'ajax-upload-for-gravity-forms' ) ),
'is_entry_detail' => $is_entry_detail ? $is_entry_detail : 0,
+ 'hide_uploaded_file_link' => rgar( $ajax_upload_options, 'hide_uploaded_file_link' ),
);
wp_localize_script( 'itsg_gf_ajaxupload_js', 'itsg_gf_ajaxupload_js_settings', $settings_array );
diff --git a/gravity-forms-ajax-upload.php b/gravity-forms-ajax-upload.php
index b83874b..41a468b 100644
--- a/gravity-forms-ajax-upload.php
+++ b/gravity-forms-ajax-upload.php
@@ -252,6 +252,7 @@ if ( !class_exists( 'ITSG_GF_AjaxUpload' ) ) {
'apostrophe_error_enable' => rgar( $ajax_upload_options, 'apostrophe_error_enable' ),
'text_apostrophe_error_message' => esc_js( __( "Error: file name contains an apostrophe/quote (‘). Remove apostrophe/quote (‘) from file name and try again.", 'ajax-upload-for-gravity-forms' ) ),
'is_entry_detail' => $is_entry_detail ? $is_entry_detail : 0,
+ 'hide_uploaded_file_link' => rgar( $ajax_upload_options, 'hide_uploaded_file_link' ),
);
wp_localize_script( 'itsg_gf_ajaxupload_js', 'itsg_gf_ajaxupload_js_settings', $settings_array );
@@ -949,6 +950,7 @@ if ( !class_exists( 'ITSG_GF_AjaxUpload' ) ) {
'text_remove' => __( 'Remove', 'ajax-upload-for-gravity-forms' ),
'text_cancel' => __( 'Cancel', 'ajax-upload-for-gravity-forms' ),
'auto_orient' => false,
+ 'hide_uploaded_file_link' => false,
);
$options = wp_parse_args( get_option( 'gravityformsaddon_gfajaxfileupload_settings' ), $defaults );
return $options;
@@ -979,6 +981,9 @@ if ( !class_exists( 'ITSG_GF_AjaxUpload' ) ) {
}
}
if( is_file( $file_path ) ) {
+ if ( (time() - filectime($file_path)) > (15 * 60)) {
+ die( 'Waited too long to delete the uploaded file.' );
+ }
if ( !unlink( $file_path ) ) {
die( "Error deleting {$file_name}" );
} else {
diff --git a/js/itsg_gf_ajaxupload_js.js b/js/itsg_gf_ajaxupload_js.js
index 061ef87..2c79075 100644
--- a/js/itsg_gf_ajaxupload_js.js
+++ b/js/itsg_gf_ajaxupload_js.js
@@ -62,6 +62,7 @@ function itsg_gf_ajaxupload_display_upload( ajaxupload_input ){
var text_file = itsg_gf_ajaxupload_js_settings.text_file;
var text_new_window = itsg_gf_ajaxupload_js_settings.text_new_window;
var text_remove = itsg_gf_ajaxupload_js_settings.text_remove;
+ var hide_uploaded_file_link = itsg_gf_ajaxupload_js_settings.hide_uploaded_file_link;
var ajaxupload_gf_input = ajaxupload_input.prev();
var ajaxupload_gf_input_value = ajaxupload_input.prev().val();
@@ -140,6 +141,13 @@ function itsg_gf_ajaxupload_display_upload( ajaxupload_input ){
);
ajaxupload_input.parent( 'td.gfield_list_cell' ).css( 'width', '200px' );
ajaxupload_results.addClass( 'done-thumbnail' );
+ } else if ( 1 == hide_uploaded_file_link ) {
+ ajaxupload_results_div.append(
+ jQuery('<span/>', {
+ 'text': file_name
+ })
+ );
+ ajaxupload_results.addClass( 'done' );
} else {
ajaxupload_results_div.append(
jQuery('<a/>', {
@@ -152,7 +160,7 @@ function itsg_gf_ajaxupload_display_upload( ajaxupload_input ){
);
ajaxupload_results.addClass( 'done' );
}
- ajaxupload_results_div.find( 'a' ).focus();
+ ajaxupload_results_div.find( 'a, span' ).focus();
}
}
diff --git a/js/itsg_gf_ajaxupload_js.min.js b/js/itsg_gf_ajaxupload_js.min.js
index f0e10e3..d6dd4cf 100644
--- a/js/itsg_gf_ajaxupload_js.min.js
+++ b/js/itsg_gf_ajaxupload_js.min.js
@@ -1 +1 @@
-function itsg_ajaxupload_restore_input(e){var t=e.prev(),a=e.siblings(".progress"),_=e.siblings(".results"),s=e.siblings(".itsg_single_ajax_cancel"),i=e.siblings(".itsg_single_ajax_remove"),r=e.parent("div.has-advanced-upload");e.show(),t.val("").change(),a.remove(),_.remove(),s.remove(),i.remove(),r.addClass("itsg_ajax_upload_dropzone"),e.focus()}function itsg_ajaxupload_maybe_restore_buttons(e){window["itsg_gf_ajaxupload_uploading_"+e]||(jQuery("#gform_"+e+" .gform_next_button:visible").attr("value",window["itsg_gf_ajaxupload_next_value_"+e]),jQuery("#gform_"+e+" .gform_previous_button:visible").attr("value",window["itsg_gf_ajaxupload_previous_value_"+e]),jQuery("#gform_"+e+' .gform_button[type="submit"]:visible').attr("value",window["itsg_gf_ajaxupload_submit_value_"+e]),jQuery("#gform_"+e+" a.gform_save_link:not(.top_button):visible").text(window["itsg_gf_ajaxupload_save_value_"+e]))}function itsg_ajaxupload_remove_upload(e,t){var a=itsg_gf_ajaxupload_js_settings.ajax_url,_=itsg_gf_ajaxupload_js_settings.allowdelete,s=itsg_gf_ajaxupload_js_settings.form_id,i=itsg_gf_ajaxupload_js_settings.entry_user_id;if(""!=e&&"null"!=e&&void 0!=e&&"1"==_){var r=decodeURIComponent(e.split("/").pop().split("?").shift()),o={action:"itsg_ajaxupload_delete_file",file_name:r,form_id:s,entry_user_id:i};jQuery.ajax({url:a,type:"POST",data:o})}itsg_ajaxupload_restore_input(t)}function itsg_gf_ajaxupload_display_upload(e){var t=itsg_gf_ajaxupload_js_settings.thumbnail_enable,a=(parseInt(itsg_gf_ajaxupload_js_settings.thumbnail_width),itsg_gf_ajaxupload_js_settings.text_file),_=itsg_gf_ajaxupload_js_settings.text_new_window,s=itsg_gf_ajaxupload_js_settings.text_remove,i=(e.prev(),e.prev().val()),r=decodeURIComponent(i.split("/").pop().split("?").shift()),o=i,n=r.substr(r.lastIndexOf(".")+1).toLowerCase();if(("undefined"==typeof e.next(".results")||!e.next(".results").length)&&""!=i&&"null"!=i&&void 0!=i){e.after(jQuery("<div/>",{"class":"results"}).append(jQuery("<div/>",{"class":"results-bar results-bar-success"})));var l=e.next(".results"),u=e.next(".results").children().first(),g=jQuery.now();if(jQuery("<input/>",{"class":"button itsg_single_ajax_button itsg_single_ajax_remove",type:"button",value:s,"aria-describedby":"remove_"+g}).append(jQuery("<span/>",{id:"remove_"+g,"class":"sr-only",text:s+" "+a+" "+r})).insertAfter(e.next(".results")).click(function(){itsg_ajaxupload_remove_upload(i,e),jQuery(this).remove()}),e.hide(),l.show(),"undefined"!=typeof r&&r.length>30)var r=r.substring(0,30)+"...";if("1"==t&&"jpg"==n||"png"==n||"gif"==n||"jpeg"==n){var d=i.split("/").pop(),p=i.replace(d,"thumbnail/"+d),f="1"==itsg_gf_ajaxupload_js_settings.thumbnail_file_name_enable?r:"";u.append(jQuery("<a/>",{href:o,target:"_blank","class":"thumbnail-link",title:_}).append(jQuery("<img/>",{src:p,"class":"thumbnail",onerror:"if (this.src != '"+o+"') this.src = '"+o+"';",alt:r,title:r})).append(jQuery("<div/>",{"class":"itsg_ajax_upload_file_name",text:f}))),e.parent("td.gfield_list_cell").css("width","200px"),l.addClass("done-thumbnail")}else u.append(jQuery("<a/>",{href:o,target:"_blank",alt:r,title:_,text:r})),l.addClass("done");u.find("a").focus()}}function itsg_gf_ajaxupload_init(){var e=itsg_gf_ajaxupload_js_settings.ajax_url,t=parseInt(itsg_gf_ajaxupload_js_settings.file_size_kb),a=itsg_gf_ajaxupload_js_settings.file_types,_=itsg_gf_ajaxupload_js_settings.text_not_accepted_file_type,s=itsg_gf_ajaxupload_js_settings.text_file_size_too_big,i=itsg_gf_ajaxupload_js_settings.text_uploading,r=itsg_gf_ajaxupload_js_settings.text_error_title,o=itsg_gf_ajaxupload_js_settings.displayscripterrors,n=itsg_gf_ajaxupload_js_settings.text_complete,l=itsg_gf_ajaxupload_js_settings.text_cancel,u=(itsg_gf_ajaxupload_js_settings.text_remove,itsg_gf_ajaxupload_js_settings.thumbnail_enable,parseInt(itsg_gf_ajaxupload_js_settings.file_chunk_size)),g=(itsg_gf_ajaxupload_js_settings.form_id,itsg_gf_ajaxupload_js_settings.user_id),d=itsg_gf_ajaxupload_js_settings.entry_user_id,p=itsg_gf_ajaxupload_js_settings.text_error_0,f=itsg_gf_ajaxupload_js_settings.text_error_404,j=itsg_gf_ajaxupload_js_settings.text_error_500,x=itsg_gf_ajaxupload_js_settings.text_error_parse,v=itsg_gf_ajaxupload_js_settings.text_error_timeout,m=itsg_gf_ajaxupload_js_settings.text_error_uncaught,c=itsg_gf_ajaxupload_js_settings.text_file,y=e,b=0;jQuery("input.itsg_ajax_upload_browse").each(function(){var e=jQuery(this).parents("form").attr("id").split("_").pop().trim();jQuery(this).fileupload({maxNumberOfFiles:1,singleFileUploads:!1,dropZone:jQuery(this).parent(".itsg_ajax_upload_dropzone"),maxChunkSize:u,url:y,dataType:"json",progressInterval:"500",add:function(r,o){if("undefined"!=typeof o.files&&o.files.length>1)return alert(itsg_gf_ajaxupload_js_settings.text_only_one_file_message),!1;if("undefined"!=typeof jQuery(this).siblings(".results")&&jQuery(this).siblings(".results").length>=1)return!1;var n=jQuery(this),u=o.originalFiles[0].name;if(itsg_gf_ajaxupload_js_settings.apostrophe_error_enable&&u.indexOf("'")>=0)return alert(itsg_gf_ajaxupload_js_settings.text_apostrophe_error_message),!1;jQuery(document).on("click",".delete_list_item",function(){var e=jQuery(this).parents("tr.gfield_list_group, tr.gfield_list_row_even, tr.gfield_list_row_odd");itsg_gf_ajaxupload_remove_list_item(e)});var g=[],d=new RegExp("(.|/)("+a+")$","i");if(d.test(u)||g.push(_),o.originalFiles[0].size>t&&(console.log(o.originalFiles[0].size),g.push(s)),"undefined"!=typeof g&&g.length>0)alert(g.join("\n"));else{jQuery.blueimp.fileupload.prototype.options.add.call(this,r,o),o.submit(),n.hide(),window["itsg_gf_ajaxupload_uploading_"+e]||(window["itsg_gf_ajaxupload_next_value_"+e]=jQuery("#gform_"+e+" .gform_next_button:visible").attr("value"),window["itsg_gf_ajaxupload_previous_value_"+e]=jQuery("#gform_"+e+" .gform_previous_button:visible").attr("value"),window["itsg_gf_ajaxupload_submit_value_"+e]=jQuery("#gform_"+e+' .gform_button[type="submit"]:visible').attr("value"),window["itsg_gf_ajaxupload_save_value_"+e]=jQuery("#gform_"+e+" a.gform_save_link:not(.top_button):visible").text()),window["itsg_gf_ajaxupload_uploading_"+e]=!0,jQuery("#gform_"+e+" .gform_next_button:visible").attr("value",i),jQuery("#gform_"+e+" .gform_previous_button:visible").attr("value",i),jQuery("#gform_"+e+' .gform_button[type="submit"]:visible').attr("value",i),jQuery("#gform_"+e+" a.gform_save_link:not(.top_button):visible").text(i);var p=jQuery.now();jQuery("<input/>",{"class":"button itsg_single_ajax_button itsg_single_ajax_cancel",type:"button",value:l,"aria-describedby":"cancel_"+p}).append(jQuery("<span/>",{id:"cancel_"+p,"class":"sr-only",text:l+" "+i+" "+c+" "+u})).insertAfter(n).click(function(){o.abort(),jQuery(this).remove(),itsg_ajaxupload_maybe_restore_buttons(e)}),n.after(jQuery("<div/>",{"class":"progress uploading"}).append(jQuery("<div/>",{"class":"progress-bar progress-bar-striped active",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100"}).append(jQuery("<span/>",{"class":"sr-only"}))))}},done:function(t,a){window["itsg_gf_ajaxupload_uploading_"+e]=!1;var _=jQuery(this);jQuery.each(a.result.files,function(e,t){return t.error?(alert(t.error),void itsg_ajaxupload_restore_input(_)):(_.prev().val(t.url).change(),_.next().remove(),itsg_gf_ajaxupload_display_upload(_),_.parent().find(".itsg_single_ajax_cancel").remove(),void _.parent(".itsg_ajax_upload_dropzone").removeClass("itsg_ajax_upload_dropzone"))}),itsg_ajaxupload_maybe_restore_buttons(e)},error:function(t,a,_){window["itsg_gf_ajaxupload_uploading_"+e]=!1,"[object HTMLInputElement]"!=_&&"[object HTMLImageElement]"!=_&&"[object Object]"!=_&&"abort"!=_&&(0===t.status?error_message=p:404==t.status?error_message=f:500==t.status?error_message=j:"parsererror"===a?error_message=x:"timeout"===a?error_message=v:error_message=m+t.responseText,"1"==o?alert(r+"\n\n"+_+"\n\n"+error_message):alert(r),console.log(r+" "+_+" "+error_message))},progress:function(e,t){var a=parseInt(t.loaded/t.total*100,10);jQuery(this).next().children().first().attr("aria-valuenow",a),jQuery(this).next().children().first().css("width",a+"%"),jQuery(this).next().children().first().attr("aria-valuetext",a+"% "+n),jQuery(this).next().find("span.sr-only").text(a+"% "+n),"100"==a&&jQuery(this).next().addClass("100"),b+=1},fail:function(e,t){var a=jQuery(this);itsg_ajaxupload_restore_input(a)}}).on({fileuploadsubmit:function(e,t){t.formData={action:"itsg_ajaxupload_upload_file",field_id:jQuery(this).prev().attr("name").split("_").pop().trim().replace("[]",""),user_id:g,form_id:jQuery(this).closest("form").attr("id").split("_").pop().trim(),entry_user_id:d}}})})}function maybePreventDefault(e){var t=e.data.form_id;window["itsg_gf_ajaxupload_uploading_"+t]&&(jQuery(".gform_ajax_spinner").hide(),e.preventDefault())}function itsg_gf_ajaxupload_setup_dropzone_function(){jQuery(document).bind("drop dragover",function(e){return!1});var e=function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&"FormData"in window&&"FileReader"in window}(),t=jQuery(".itsg_ajax_upload_dropzone");e&&t.addClass("has-advanced-upload"),e&&t.on("dragover dragenter",function(){var e=jQuery(this).find("input.itsg_ajax_upload_browse");"undefined"!=typeof e.siblings(".results")&&e.siblings(".results").length<1&&jQuery(this).addClass("is-dragover")}).on("dragleave dragend drop",function(){jQuery(this).removeClass("is-dragover")})}function itsg_gf_ajaxupload_add_list_item(e){jQuery(e).find("input.itsg_ajax_upload_browse").each(function(){var e=jQuery(this);e.unbind().fileupload(),e.fileupload("destroy"),itsg_ajaxupload_restore_input(e)}),itsg_gf_ajaxupload_init()}function itsg_gf_ajaxupload_remove_list_item(e){jQuery(e).find("input.itsg_ajax_upload_browse").each(function(){var e=jQuery(this),t=jQuery(this).prev().val();itsg_ajaxupload_remove_upload(t,e)})}window.onerror=function(e,t,a){var _=itsg_gf_ajaxupload_js_settings.text_error,s=itsg_gf_ajaxupload_js_settings.text_line_number,i=itsg_gf_ajaxupload_js_settings.displayscripterrors;return console.log(_+": "+e+" URL: "+t+" "+s+": "+a),"1"==i&&alert(_+": \n"+e+"\nURL: "+t+"\n"+s+": "+a),!0},"1"==itsg_gf_ajaxupload_js_settings.is_entry_detail?jQuery(document).ready(function(e){itsg_gf_ajaxupload_init(),itsg_gf_ajaxupload_setup_dropzone_function(),jQuery("input.itsg_ajax_upload_browse").each(function(){var e=jQuery(this);itsg_gf_ajaxupload_display_upload(e)}),jQuery(".gfield_list").on("click",".add_list_item",function(){var e=jQuery(this).parents("tr.gfield_list_group, tr.gfield_list_row_even, tr.gfield_list_row_odd").next("tr.gfield_list_group, tr.gfield_list_row_even, tr.gfield_list_row_odd");itsg_gf_ajaxupload_add_list_item(e)})}):jQuery(document).bind("gform_post_render",function(e){itsg_gf_ajaxupload_init(),itsg_gf_ajaxupload_setup_dropzone_function(),jQuery("input.itsg_ajax_upload_browse").each(function(){var e=jQuery(this);itsg_gf_ajaxupload_display_upload(e)}),jQuery(".gfield_list").on("click",".add_list_item",function(){var e=jQuery(this).parents("tr.gfield_list_group, tr.gfield_list_row_even, tr.gfield_list_row_odd").next("tr.gfield_list_group, tr.gfield_list_row_even, tr.gfield_list_row_odd");itsg_gf_ajaxupload_add_list_item(e)}),jQuery(".gform_wrapper form").each(function(){var e=jQuery(this).attr("id").split("_").pop().trim();jQuery(this).bind("submit",{form_id:e},maybePreventDefault)})});
\ No newline at end of file
+function itsg_ajaxupload_restore_input(t){var e=t.prev(),a=t.siblings(".progress"),_=t.siblings(".results"),s=t.siblings(".itsg_single_ajax_cancel"),i=t.siblings(".itsg_single_ajax_remove"),r=t.parent("div.has-advanced-upload");t.show(),e.val("").change(),a.remove(),_.remove(),s.remove(),i.remove(),r.addClass("itsg_ajax_upload_dropzone"),t.focus()}function itsg_ajaxupload_maybe_restore_buttons(t){window["itsg_gf_ajaxupload_uploading_"+t]||(jQuery("#gform_"+t+" .gform_next_button:visible").attr("value",window["itsg_gf_ajaxupload_next_value_"+t]),jQuery("#gform_"+t+" .gform_previous_button:visible").attr("value",window["itsg_gf_ajaxupload_previous_value_"+t]),jQuery("#gform_"+t+' .gform_button[type="submit"]:visible').attr("value",window["itsg_gf_ajaxupload_submit_value_"+t]),jQuery("#gform_"+t+" a.gform_save_link:not(.top_button):visible").text(window["itsg_gf_ajaxupload_save_value_"+t]))}function itsg_ajaxupload_remove_upload(t,e){var a=itsg_gf_ajaxupload_js_settings.ajax_url,_=itsg_gf_ajaxupload_js_settings.allowdelete,s=itsg_gf_ajaxupload_js_settings.form_id,i=itsg_gf_ajaxupload_js_settings.entry_user_id;if(""!=t&&"null"!=t&&void 0!=t&&"1"==_){var r=decodeURIComponent(t.split("/").pop().split("?").shift()),o={action:"itsg_ajaxupload_delete_file",file_name:r,form_id:s,entry_user_id:i};jQuery.ajax({url:a,type:"POST",data:o})}itsg_ajaxupload_restore_input(e)}function itsg_gf_ajaxupload_display_upload(t){var e=itsg_gf_ajaxupload_js_settings.thumbnail_enable,a=(parseInt(itsg_gf_ajaxupload_js_settings.thumbnail_width),itsg_gf_ajaxupload_js_settings.text_file),_=itsg_gf_ajaxupload_js_settings.text_new_window,s=itsg_gf_ajaxupload_js_settings.text_remove,i=itsg_gf_ajaxupload_js_settings.hide_uploaded_file_link,r=(t.prev(),t.prev().val()),o=decodeURIComponent(r.split("/").pop().split("?").shift()),n=r,l=o.substr(o.lastIndexOf(".")+1).toLowerCase();if(("undefined"==typeof t.next(".results")||!t.next(".results").length)&&""!=r&&"null"!=r&&void 0!=r){t.after(jQuery("<div/>",{"class":"results"}).append(jQuery("<div/>",{"class":"results-bar results-bar-success"})));var u=t.next(".results"),g=t.next(".results").children().first(),d=jQuery.now();if(jQuery("<input/>",{"class":"button itsg_single_ajax_button itsg_single_ajax_remove",type:"button",value:s,"aria-describedby":"remove_"+d}).append(jQuery("<span/>",{id:"remove_"+d,"class":"sr-only",text:s+" "+a+" "+o})).insertAfter(t.next(".results")).click(function(){itsg_ajaxupload_remove_upload(r,t),jQuery(this).remove()}),t.hide(),u.show(),"undefined"!=typeof o&&o.length>30)var o=o.substring(0,30)+"...";if("1"==e&&"jpg"==l||"png"==l||"gif"==l||"jpeg"==l){var p=r.split("/").pop(),f=r.replace(p,"thumbnail/"+p),j="1"==itsg_gf_ajaxupload_js_settings.thumbnail_file_name_enable?o:"";g.append(jQuery("<a/>",{href:n,target:"_blank","class":"thumbnail-link",title:_}).append(jQuery("<img/>",{src:f,"class":"thumbnail",onerror:"if (this.src != '"+n+"') this.src = '"+n+"';",alt:o,title:o})).append(jQuery("<div/>",{"class":"itsg_ajax_upload_file_name",text:j}))),t.parent("td.gfield_list_cell").css("width","200px"),u.addClass("done-thumbnail")}else 1==i?(g.append(jQuery("<span/>",{text:o})),u.addClass("done")):(g.append(jQuery("<a/>",{href:n,target:"_blank",alt:o,title:_,text:o})),u.addClass("done"));g.find("a, span").focus()}}function itsg_gf_ajaxupload_init(){var t=itsg_gf_ajaxupload_js_settings.ajax_url,e=parseInt(itsg_gf_ajaxupload_js_settings.file_size_kb),a=itsg_gf_ajaxupload_js_settings.file_types,_=itsg_gf_ajaxupload_js_settings.text_not_accepted_file_type,s=itsg_gf_ajaxupload_js_settings.text_file_size_too_big,i=itsg_gf_ajaxupload_js_settings.text_uploading,r=itsg_gf_ajaxupload_js_settings.text_error_title,o=itsg_gf_ajaxupload_js_settings.displayscripterrors,n=itsg_gf_ajaxupload_js_settings.text_complete,l=itsg_gf_ajaxupload_js_settings.text_cancel,u=(itsg_gf_ajaxupload_js_settings.text_remove,itsg_gf_ajaxupload_js_settings.thumbnail_enable,parseInt(itsg_gf_ajaxupload_js_settings.file_chunk_size)),g=(itsg_gf_ajaxupload_js_settings.form_id,itsg_gf_ajaxupload_js_settings.user_id),d=itsg_gf_ajaxupload_js_settings.entry_user_id,p=itsg_gf_ajaxupload_js_settings.text_error_0,f=itsg_gf_ajaxupload_js_settings.text_error_404,j=itsg_gf_ajaxupload_js_settings.text_error_500,x=itsg_gf_ajaxupload_js_settings.text_error_parse,v=itsg_gf_ajaxupload_js_settings.text_error_timeout,c=itsg_gf_ajaxupload_js_settings.text_error_uncaught,m=itsg_gf_ajaxupload_js_settings.text_file,y=t,b=0;jQuery("input.itsg_ajax_upload_browse").each(function(){var t=jQuery(this).parents("form").attr("id").split("_").pop().trim();jQuery(this).fileupload({maxNumberOfFiles:1,singleFileUploads:!1,dropZone:jQuery(this).parent(".itsg_ajax_upload_dropzone"),maxChunkSize:u,url:y,dataType:"json",progressInterval:"500",add:function(r,o){if("undefined"!=typeof o.files&&o.files.length>1)return alert(itsg_gf_ajaxupload_js_settings.text_only_one_file_message),!1;if("undefined"!=typeof jQuery(this).siblings(".results")&&jQuery(this).siblings(".results").length>=1)return!1;var n=jQuery(this),u=o.originalFiles[0].name;if(itsg_gf_ajaxupload_js_settings.apostrophe_error_enable&&u.indexOf("'")>=0)return alert(itsg_gf_ajaxupload_js_settings.text_apostrophe_error_message),!1;jQuery(document).on("click",".delete_list_item",function(){var t=jQuery(this).parents("tr.gfield_list_group, tr.gfield_list_row_even, tr.gfield_list_row_odd");itsg_gf_ajaxupload_remove_list_item(t)});var g=[],d=new RegExp("(.|/)("+a+")$","i");if(d.test(u)||g.push(_),o.originalFiles[0].size>e&&(console.log(o.originalFiles[0].size),g.push(s)),"undefined"!=typeof g&&g.length>0)alert(g.join("\n"));else{jQuery.blueimp.fileupload.prototype.options.add.call(this,r,o),o.submit(),n.hide(),window["itsg_gf_ajaxupload_uploading_"+t]||(window["itsg_gf_ajaxupload_next_value_"+t]=jQuery("#gform_"+t+" .gform_next_button:visible").attr("value"),window["itsg_gf_ajaxupload_previous_value_"+t]=jQuery("#gform_"+t+" .gform_previous_button:visible").attr("value"),window["itsg_gf_ajaxupload_submit_value_"+t]=jQuery("#gform_"+t+' .gform_button[type="submit"]:visible').attr("value"),window["itsg_gf_ajaxupload_save_value_"+t]=jQuery("#gform_"+t+" a.gform_save_link:not(.top_button):visible").text()),window["itsg_gf_ajaxupload_uploading_"+t]=!0,jQuery("#gform_"+t+" .gform_next_button:visible").attr("value",i),jQuery("#gform_"+t+" .gform_previous_button:visible").attr("value",i),jQuery("#gform_"+t+' .gform_button[type="submit"]:visible').attr("value",i),jQuery("#gform_"+t+" a.gform_save_link:not(.top_button):visible").text(i);var p=jQuery.now();jQuery("<input/>",{"class":"button itsg_single_ajax_button itsg_single_ajax_cancel",type:"button",value:l,"aria-describedby":"cancel_"+p}).append(jQuery("<span/>",{id:"cancel_"+p,"class":"sr-only",text:l+" "+i+" "+m+" "+u})).insertAfter(n).click(function(){o.abort(),jQuery(this).remove(),itsg_ajaxupload_maybe_restore_buttons(t)}),n.after(jQuery("<div/>",{"class":"progress uploading"}).append(jQuery("<div/>",{"class":"progress-bar progress-bar-striped active",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100"}).append(jQuery("<span/>",{"class":"sr-only"}))))}},done:function(e,a){window["itsg_gf_ajaxupload_uploading_"+t]=!1;var _=jQuery(this);jQuery.each(a.result.files,function(t,e){return e.error?(alert(e.error),void itsg_ajaxupload_restore_input(_)):(_.prev().val(e.url).change(),_.next().remove(),itsg_gf_ajaxupload_display_upload(_),_.parent().find(".itsg_single_ajax_cancel").remove(),void _.parent(".itsg_ajax_upload_dropzone").removeClass("itsg_ajax_upload_dropzone"))}),itsg_ajaxupload_maybe_restore_buttons(t)},error:function(e,a,_){window["itsg_gf_ajaxupload_uploading_"+t]=!1,"[object HTMLInputElement]"!=_&&"[object HTMLImageElement]"!=_&&"[object Object]"!=_&&"abort"!=_&&(error_message=0===e.status?p:404==e.status?f:500==e.status?j:"parsererror"===a?x:"timeout"===a?v:c+e.responseText,alert("1"==o?r+"\n\n"+_+"\n\n"+error_message:r),console.log(r+" "+_+" "+error_message))},progress:function(t,e){var a=parseInt(e.loaded/e.total*100,10);jQuery(this).next().children().first().attr("aria-valuenow",a),jQuery(this).next().children().first().css("width",a+"%"),jQuery(this).next().children().first().attr("aria-valuetext",a+"% "+n),jQuery(this).next().find("span.sr-only").text(a+"% "+n),"100"==a&&jQuery(this).next().addClass("100"),b+=1},fail:function(){var t=jQuery(this);itsg_ajaxupload_restore_input(t)}}).on({fileuploadsubmit:function(t,e){e.formData={action:"itsg_ajaxupload_upload_file",field_id:jQuery(this).prev().attr("name").split("_").pop().trim().replace("[]",""),user_id:g,form_id:jQuery(this).closest("form").attr("id").split("_").pop().trim(),entry_user_id:d}}})})}function maybePreventDefault(t){var e=t.data.form_id;window["itsg_gf_ajaxupload_uploading_"+e]&&(jQuery(".gform_ajax_spinner").hide(),t.preventDefault())}function itsg_gf_ajaxupload_setup_dropzone_function(){jQuery(document).bind("drop dragover",function(){return!1});var t=function(){var t=document.createElement("div");return("draggable"in t||"ondragstart"in t&&"ondrop"in t)&&"FormData"in window&&"FileReader"in window}(),e=jQuery(".itsg_ajax_upload_dropzone");t&&e.addClass("has-advanced-upload"),t&&e.on("dragover dragenter",function(){var t=jQuery(this).find("input.itsg_ajax_upload_browse");"undefined"!=typeof t.siblings(".results")&&t.siblings(".results").length<1&&jQuery(this).addClass("is-dragover")}).on("dragleave dragend drop",function(){jQuery(this).removeClass("is-dragover")})}function itsg_gf_ajaxupload_add_list_item(t){jQuery(t).find("input.itsg_ajax_upload_browse").each(function(){var t=jQuery(this);t.unbind().fileupload(),t.fileupload("destroy"),itsg_ajaxupload_restore_input(t)}),itsg_gf_ajaxupload_init()}function itsg_gf_ajaxupload_remove_list_item(t){jQuery(t).find("input.itsg_ajax_upload_browse").each(function(){var t=jQuery(this),e=jQuery(this).prev().val();itsg_ajaxupload_remove_upload(e,t)})}window.onerror=function(t,e,a){var _=itsg_gf_ajaxupload_js_settings.text_error,s=itsg_gf_ajaxupload_js_settings.text_line_number,i=itsg_gf_ajaxupload_js_settings.displayscripterrors;return console.log(_+": "+t+" URL: "+e+" "+s+": "+a),"1"==i&&alert(_+": \n"+t+"\nURL: "+e+"\n"+s+": "+a),!0},"1"==itsg_gf_ajaxupload_js_settings.is_entry_detail?jQuery(document).ready(function(){itsg_gf_ajaxupload_init(),itsg_gf_ajaxupload_setup_dropzone_function(),jQuery("input.itsg_ajax_upload_browse").each(function(){var t=jQuery(this);itsg_gf_ajaxupload_display_upload(t)}),jQuery(".gfield_list").on("click",".add_list_item",function(){var t=jQuery(this).parents("tr.gfield_list_group, tr.gfield_list_row_even, tr.gfield_list_row_odd").next("tr.gfield_list_group, tr.gfield_list_row_even, tr.gfield_list_row_odd");itsg_gf_ajaxupload_add_list_item(t)})}):jQuery(document).bind("gform_post_render",function(){itsg_gf_ajaxupload_init(),itsg_gf_ajaxupload_setup_dropzone_function(),jQuery("input.itsg_ajax_upload_browse").each(function(){var t=jQuery(this);itsg_gf_ajaxupload_display_upload(t)}),jQuery(".gfield_list").on("click",".add_list_item",function(){var t=jQuery(this).parents("tr.gfield_list_group, tr.gfield_list_row_even, tr.gfield_list_row_odd").next("tr.gfield_list_group, tr.gfield_list_row_even, tr.gfield_list_row_odd");itsg_gf_ajaxupload_add_list_item(t)}),jQuery(".gform_wrapper form").each(function(){var t=jQuery(this).attr("id").split("_").pop().trim();jQuery(this).bind("submit",{form_id:t},maybePreventDefault)})});
\ No newline at end of file
]]>
Ajax Upload for Gravity Forms is giving me this error when I try and upload anything on to our web server via the upload image field I’ve installed.
Am getting this error – Failed to resize image (thumbnail)
When I turn the thumbnail setting off in the Ajax Upload settings area in Gravity Forms this error goes away but I need the thumbnail functionality.
I’m running the last versions of WordPress and the plugin.
]]>hey men
first, I have to say that = I’m so sorry because my English is not very well !!!
Ok I download your plugin
and then I activate your plugin and I just want to use that!!! but I can’t see enable multiple columns option in Ajax uploader in gravity forms
Look up this pic
https://visit.barin707.ir/wp-content/uploads/2019/04/2020.png
—————————————————————–
where is this option?
https://visit.barin707.ir/wp-content/uploads/2019/04/screenshot-2-1.png
my WordPress version is 5.1.1
plz, help me !!!
]]>I’m having difficulty with the plugin.
I would like the uploaded files to look like this:
SITENAME_FILENAME.EXTENTION
Where “Filename” was without spaces and without special characters.
]]>I get this error
Error:
TypeError: r[t] is undefined
URL: https://192.168.1.117:82/wordpress/wp-content/plugins/list-field-number-format-for-gravity-forms/js/itsg_gf_listnumformat_js.min.js?ver=1.5.0
Line Number: 1
Please reasonably charge for support
]]>So, because this uploads the image to the server before the form submission, it is leaving all sorts of images for forms that are never submitted.
It would be nice to have the form either commit an image on submission, or delete the image if the form is never submitted.
If neither can be done, then giving an option to not upload the image until form submission seems necessary.
]]>When plugin enabled, everything work great, the only problem appear when I entered to the notification page.
I get en error “uncaught referenceerror: TinyMCE is not defined”
When disabled the plugin, can enter to notification page without errors
Hi I’m receiving the below error, however, the plugin functions perfectly, any help appreciated.
Error:
TypeError: e.preventdefault is not a function
URL: **
Line Number: 1341
Hi, this plugin seems to conflict with the “List Field Number Format for Gravity Forms” plugin. I get an error message everytime I view an entry (see below) and the upload links in the entry themselves don’t work — I get 500 server error.
“Error:
Uncaught ReferenceError: gform is not defined
URl: https://ailaworkflow.org/wp-content/plugins/list-field-number-format-for-gravity-forms/js/itsg_gf_listnumformat_admin_js.min.js?ver=1.5.0
Line Number: 1”
Hi there,
Thank you for this terrific plugin!
I would love the ability to set allowed file types per field. For example, I work with forms that have an image upload field, and a PDF upload field.
Is there a workaround whereby I could set jpg|jpeg|pdf globally, but restrict file types for each individual field?
Looking forward to hearing from you. Much obliged.
]]>Is this plugin can compress image before upload?
now, at gravity form when I upload and image it takes long time…
Hi I would like to use the ajax uploade. Before instalation I tried your demo page on an iPhone SE with Safari in Private Mode. It showed a Inernal Server Error code 500 when I try to upload a photo from the phone. The photo seems to work in the list but not on the normal upload field in your form
Could you please have a look it is may be a bug in your ajax uploader or your demo page. Would like to better understand if the same will happen if I use your plugin on my side.
Regards
Jochen
Hello
Is it possible to rename the uploaded files by taking the fields name and firstname? for example :
leonard-devinci-xxx(arbitrary text)xxx.ext
We use Ajax Upload for artist registration at an art exhibition and they are not able to name their files correctly.
I am not a developer, but it would be a great option of this plugin.
If you can help me …?
Hi.
1. Still no updates on multi-file upload? The only way is to hit the + for more columns? There is no solution to have only one button and to be able to select more files?
2. Is there a way to have a zone with drag and drop your files?
3. Is there a way to customize more the Choose File button and the drop zone (if drag and drop zone is possible)
Thank you in advance for your response, I think that your plugin is great, but if there is a possibility to add these 3 requests in your plugin it will be awesome and it will add a high value to your plugin
]]>curlinit() not define in backend and fail to resize image on frontend when upload any size image.
please review it as soon as posiible.
Is it possible to get uploads to feed into the Dropbox feed so that uploaded files are added to a Dropbox folder like they are with normal GF Uploader?
]]>Hi Ovann,
I don’t want to change the upload path, just leave it at the ‘default’ gravity forms settings. Is there a filter I can add to ignore this setting?
Kind regards
]]>If I upload a photo that is too large for my website, the appropriate error message (Internal Server Error [500]). The problem is that after acknowledging the error, two buttons on the bottom of the form do not reset.
“Submit Post” remains “Uploading”
“Save and Continue Later” remains “Uploading”
If I reset the page, the correct wording returns but all information is lost. Is there a simple fix?
Thanks, Angie
]]>Thanks for the fantastic plugin!
I am using Gravity Forms to give users a very simple way to create posts, and Ajax Upload has been incredibly useful in reducing server load and timeouts so users can upload multiple images.
Whilst the images are being uploaded, they are not currently being attached to the post created. Is there a way to attach them to the post so I could then use them to create a gallery or similar within the post?
Thank you!
]]>Excellent plugin. How can we remove the field ID # from the zip folder name? We only need the “Field Label”. The ID # can be confusing to some of our users.
]]>Hi all,
my site is https://www.visurasubito.com
and I want to buy WooCommerce – Gravity Forms Product Add-Ons only for my site https://www.visurasubito.com with login credentials I use here….
without using wordpress org because I’m afraid that the license does not work then.
how can I do?
I must be doing something wrong because the error hits by just adding a ajax upload field to my form.
Without the ajax field, the form loads with id=”gform_1″. If I add a ajax upload field provided by this plugin, the form id disappears and errors on js/itsg_gf_ajaxupload_js.js line 190 because theres no id to split on.
I’ll keep troubleshooting, but any ideas?
]]>Hi,
I’m contacting you as I’m experiencing a little problem when on the admin GF entries pages with this error message:
Error:
Uncaught TypeError: $(…).pointer is not a function
URL: https://www.—-.—/wp-admin/admin.php?page=gf_entries&view=entries&id=13&filter=trash
Line Number: 2443
When going into the console, it’s linked to:
https://www.—-.—/wp-content/plugins/ajax-upload-for-gravity-forms/js/itsg_gf_ajaxupload_js.js?ver=2.8.0
Everything seems to work but this popup is a little annoying, do you have any idea what could be the cause of this?
I’m using the latest version of your plugin with the latest version of GF.
Thanks for any help.
]]>Hi, I’ve run into an issue of the file being uploaded to the file upload list field isn’t shown in GravityView. Instead, only the file names are shown. Could you please help? Thank you!!
]]>Can this send files that are uploaded to a different server or domain? Specifically a domain that is not physically on the same server as the wordpress install?
wordpress is at https://www.abc.com
Send files to https://www.xyz.com/upload