BOOTSTRAP UPLOADS

24 replies · opened Apr 25, 2022

Jjaih2Apr 25, 2022

Hi!
Tell me how to add a limit on the total size of uploaded files in "SELECT MULTIPLE ITEMS" and a ban on certain types of files.

Also when using any form with reCAPTCHA v2 from google when you click on "send" without confirming reCAPTCHA v2 a red notification appears, when passing reCAPTCHA v2 and pressing "send" the same red notification appears, but at the same time the sending occurs.
contact-5-recaptcha.html

Jjaih2Apr 26, 2022

Guys?

SSemicolon WebSTAFFApr 27, 2022

Hello,

Apologies for the Delays in replying and Thanks for your Kind Patience!

  1. You can consider using the input's accept Attribute to define accepted file extensions: https://www.w3schools.com/tags/att_input_accept.asp .

  2. You can consider using the maxFileSize Setting: https://plugins.krajee.com/file-input/plugin-options#maxFileSize for the Uploads Component.

  3. There appears to be some error with the reCaptcha core functions. We are looking into this and will provide you with with an update shortly. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Jjaih2Apr 27, 2022

I found this solution but it doesn't fit the new version of form.php

// Runs only when File Field is present in the Contact Form
if ( isset( $_FILES['template-contactform-file'] ) && $_FILES['template-contactform-file']['error'] == UPLOAD_ERR_OK ) {

	$allowed_files = array('application/doc', 'application/pdf', 'another/type');

	if( !in_array( $_FILES['template-contactform-file']['type'], $allowed_files ) ) {
		echo '{ "alert": "error", "message": "File type not allowed! Please Try Again." }';
		die;
	}

	if( $_FILES["template-contactform-file"]["size"] > 4000000 ) { // 4MB
		echo '{ "alert": "error", "message": "File Size exceeds the Limit! Please Try Again." }';
		die;
	}

	$mail->IsHTML(true);
	$mail->AddAttachment( $_FILES['template-contactform-file']['tmp_name'], $_FILES['template-contactform-file']['name'] );
}
SSemicolon WebSTAFFApr 27, 2022

Hello,

This JS Setting needs to be added at the bottom of the HTML File inside the File Uploads initialization Codes: $("#selector").fileinput.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

SSemicolon WebSTAFFApr 27, 2022

Hello,

With Bootstrap Uploads the PHP Solution is currently not supported and will require many Customizations. We will definitely try adding this feature in a future update and let you know once this is available.

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Jjaih2Apr 27, 2022

<script >
$(document).ready(function() {

		$("input-3").fileinput({
			maxFileSize: "24000KB",
			msgSizeTooLarge: "File "{name}" (&lt;b&gt;{size} KB&lt;/b&gt;) exceeds maximum allowed upload size of &lt;b&gt;{maxSize} KB&lt;/b&gt;. Please retry your upload!"
		});
		
	});

&lt;/script&gt;

???

SSemicolon WebSTAFFApr 27, 2022

Yes, thats correct.

Jjaih2Apr 27, 2022

this code is not working


		$(document).ready(function() {

			$("input-3").fileinput({
				maxFileSize: 24000,
				msgSizeTooLarge: 'File "{name}" (**{customSize}**) exceeds maximum allowed upload size of **{customMaxSize}**. Please retry your upload!'
			});
			
		});

	
Jjaih2Apr 27, 2022

On this form, this code does not work at all


	
	

	
	
- 
	
- 
	
- 
	
- 
	
- 
	
- 
	
- 
	
- 

	
	
- 

	
- 
	

	
	Bootstrap Uploads | Canvas

	
	

		
		

			
				Bootstrap Uploads
				
					
- [Home](#)
					
- [Shortcodes](#)
					
- Bootstrap Uploads
				
			

		

		
		
			
				

					
						
						

							
								
								
									Select Multiple Items:

									
									
								

								
							

						

					

				
			
		

	

	
	

	
	
	

	
	

	
	

	
		$(document).ready(function() {
			$("input-3").fileinput({
				showPreview: false,
				maxFileSize: 24000,
				msgSizeTooLarge: 'File "{name}" (**{customSize}**) exceeds maximum allowed upload size of **{customMaxSize}**. Please retry your upload!'
				elErrorContainer: "#errorBlock"
			});

		});

	
Jjaih2Apr 27, 2022

Even your code doesn't work on this form
<div id="errorBlock" class="form-text"></div> - Has been added to the form

$("#input-3").fileinput({
				showPreview: false,
				allowedFileExtensions: ["zip", "rar", "gz", "tgz"],
				elErrorContainer: "#errorBlock"
			});
Jjaih2Apr 27, 2022

	
	

	
	
- 
	
- 
	
- 
	
- 
	
- 
	
- 
	
- 
	
- 

	
	
- 

	
- 
	

	
	Bootstrap Uploads | Canvas

	
	

		
		
			
				

					
						
						

							
								
									Change size of whole widget:

									
								
							

						
					

				
			
		

		

	

	
	

	
	
	

	
	

	
	

	
		$(document).ready(function() {
			

			$("#input-6").fileinput({
				showUpload: false,
				maxFileCount: 20,
				maxFileSize: 24000,
				msgSizeTooLarge: 'File "{name}" (**{customSize}**) exceeds maximum allowed upload size of **{customMaxSize}**. Please retry your upload!',
				showCaption: true
			});
		});

	

This code works.

But I can't seem to get this code to work. msgSizeTooLarge: 'File "{name}" (**{customSize}**) exceeds maximum allowed upload size of **{customMaxSize}**. Please retry your upload!'

Jjaih2Apr 27, 2022

Where can I edit this notice?

Jjaih2Apr 27, 2022

It's outrageous! The first time I contacted with your support and you did not help me at all!

I waited 3 days to get a response from you that does not work. I had to spend 4 hours to understand your code and solve the problem myself!

Were you too lazy to send me these lines of code?

$("#input-6").fileinput({
				showUpload: false,
				maxFileCount: 20,
				maxFileSize: 24000,
				msgSizeTooLarge: 'File "{name}" (**{customSize}**) exceeds maximum allowed upload size of **{customMaxSize}**. Please retry your upload!',
				showCaption: true,
				elErrorContainer: "#errorBlock"
			});

I'm shocked by your customer service.

SSemicolon WebSTAFFApr 27, 2022

Hello,

Apologies for the Inconveniences caused!

Our Standard Support Times are 1 Business Day. However, we did experience delays in replying to your Support Query but the response from our Support Team was within 2 Business Days (not 3 Days). We absolutely apologize for the 1 Day delay in replying, however this happens very very rarely. We will make sure that there are no further delays in the future.

The Codes provided to you were accurate based on your Initial support Query and does work conflict with the Default Functionalities. We do not include modified versions of the Plugin. The Use Case of your Support Query comes under specific customizations as these codes are not included with the Templates provided within the Package, and we currently do not provide Customization related Support according to the Item Support Policy: https://themeforest.net/page/item_support_policy . While we are more than happy to help you with minor customizations as we always have in the past, Our Support Teams are present in different time zones and the turnaround times can be around 6-10 hours.

Let us know if we can help you with anything else or if you find any further issues.

Jjaih2Apr 27, 2022

I only needed 2 lines of code from you...

Jjaih2Apr 27, 2022

$(document).ready(function() {

$(“input-3”).fileinput({
maxFileSize: “24000KB”,
msgSizeTooLarge: “File “{name}” (**{size} KB**) exceeds maximum allowed upload size of **{maxSize} KB**. Please retry your upload!”
});

});

To this incorrect piece of code, you answered that it is correct ...

For gmohdezb, you rewrote almost half of form.php
https://support.semicolonweb.com/forums/topic/contact-form-attachment-file-size/

I won't argue with you. But all this is sad.

SSemicolon WebSTAFFApr 27, 2022

We Understand and we are more than Happy to Help you. However, we request you to allow us to reply you within the Support Times.

SSemicolon WebSTAFFApr 28, 2022

Hello,

We have fixed the issue with the Contact Form reCaptcha showing wrong notifications. Please update the existing js/plugins.min.js File with the updated one attached to this reply.

This will definitely fix the issue. Hope this Helps!

Apologies for the Bug and Thanks for your Kind Patience!

Let us know if we can help you with anything else or if you find any further issues.

Jjaih2Apr 28, 2022

Yes! Everything works thank you very much!

Jjaih2Apr 28, 2022

Sorry! Give me a couple of minutes.

SSemicolon WebSTAFFApr 28, 2022

Hello,

Can you please provide us with a Live URL so that we can check out the exact issue and provide you with more accurate assistance on this as we have tested this extensively before providing you with the updated file. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Jjaih2Apr 28, 2022

Everything works thank you very much!

SSemicolon WebSTAFFApr 28, 2022

Glad the issue was resolved.

Please let us know if we can help you with anything else.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard