Forums

Speed problems causing actions to be pypassed

saveg 11 Jan, 2020
in cf6 Im seeing a very strange problems.
I know for a fact that some users are having a low speed internet connections and they try to use the below page to upload around 15 files and I do apply file check on size and ext then if success I do rename the file
for a strange reason some users are uploading with no problems others are uploading files but I dont know what exactly they have done so that the db gets wrong file names (old initial pre rename file name) I cant find a logical answer to this, but im assuming a low speed internet causes the page to break the upload and allows the user to continur and submit.
can someone pls inspect and let me know where exactly the failure?
healyhatman 12 Jan, 2020
Could always split it up over a few pages instead
GreyHead 12 Jan, 2020
Hi saveg,

Split the file uploads up between several form pages. The way it works is that on submit the files are uploaded to your server - then ChronoForms gets to check the uploads so you can't prevent over-size uploads from being uploaded.

Bob
saveg 12 Jan, 2020
lets assume that I cant distrubute those file uploads throughout the pages. I have found out that max exec time is default to 30 sec. Ive increased the max exec time to 120 sec and things are better not but im still getting 1 out of 10 applicants is somehow bypassing the actions and im getting empty db fields for file name while actually files were uploaded.
shall I increase the max exec time to 180???
healyhatman 12 Jan, 2020
No. The file uploads to server happen on submission, AND THEN all the things run - if you have it set up properly it's not possible that the values are entering the DB wrong due to anything speed related. The server doesn't go "aww jeez this is taking a while I'll just skip this bit of code". If it's hitting the max execution time it'll simply stop and throw an error. Double check the logic.
saveg 12 Jan, 2020
Ok I see, but I cant spot any wrong logic
its file upload acttion -> check if size ok and ext allowed -> rename file and proceed. if fail then do page redirect as you can see in my screen above.
Am I missing anything??
what Ive concluded is that the user is panicking and pressing back and then press on submit. Im but out of clues to understand whats causing this. coz Im seeing it happening on the users coming from one country only and Ive checked the speed its very slow upload speed. so it could be the user is not waiting and MAYBE he presses back then submit again .
another strange thing is that I have inserted a save db action after the files action as you can see. the db rows are inserted several time for the same user. and again only from certain users in one country only.
can you spot anything??
GreyHead 13 Jan, 2020
Hi saveg,

I suggest that you add JavaScript to disable the Submit button once it is clicked the first time, that should block duplicate submissions. You could also show a 'loading' icon at the same time. There is a FAQ here written for CFv4 that will give you the basics.

Bob
saveg 14 Jan, 2020
Thanks we did, but we still dont understand the logic of why things are breaking on some users only. do you spot and logic problem ??
GreyHead 14 Jan, 2020
Hi saveg,

Not beyond your suggestion that some of them with slow-upload are re-clicking the submit button.

Bob
saveg 16 Jan, 2020
my friend, http://www.chronoengine.com/faqs/2560-how-do-i-show-a-loading-message-when-the-form-submits is on cf4 cf6 seems to have more options, can you pls explain how do we apply it on cf6???
healyhatman 16 Jan, 2020
jQuery(document).ready(function($) {
jQuery('.ui.form').submit(function(event) {
// Not sure if this will work try anyway
if(jQuery(this).form("is valid")) {
jQuery('#id_of_your_submit_button_goes_here').addClass('disabled');
}
});
});
This topic is locked and no more replies can be posted.