Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 error when I want to send form #130

Open
jaroslav-mor opened this issue Apr 13, 2022 · 1 comment
Open

403 error when I want to send form #130

jaroslav-mor opened this issue Apr 13, 2022 · 1 comment

Comments

@jaroslav-mor
Copy link

jaroslav-mor commented Apr 13, 2022

I have custom form(with custom php, built on phpmailer) when I added my template to batflat, I've got problem with form redirections. When attachment is too big it should redirect to my custom html error page. Instead of this I have error 403, without batflat it works fine.

@haydius
Copy link

haydius commented Jan 17, 2023

HI @jaroslav-mor ,

You could possibly fix this by implementing a quick filesize check on client-side using JavaScript if you know the max upload availability. Just update the form HTML accordingly referencing the example below:

<input type="file" id="file">
<div id="notice"></div>
<script>
var fileUpload = document.getElementById("file");

fileUpload.onchange = function() {
    if(this.files[0].size > 10485760){  //10MB (10*1024*1024bytes)
       this.value = ""; // clear the file upload input
       document.getElementById('notice').innerHTML = '<span style="color:red;">The selected file exceeded 10MB and could not be uploaded.</span>';
    };
};
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants