theaha Posted September 28, 2023 Share Posted September 28, 2023 I use method Quote UnimFileUploadButton1.JSInterface.JSConfig('maxSize','1000000'); but not work. any solution? Unigui version 190.0.1568 Link to comment Share on other sites More sharing options...
Sherzod Posted September 28, 2023 Share Posted September 28, 2023 Hello, 6 minutes ago, theaha said: Unigui version 190.0.1568 Edition? Not trial? Link to comment Share on other sites More sharing options...
theaha Posted September 28, 2023 Author Share Posted September 28, 2023 2 hours ago, Sherzod said: Hello, Edition? Not trial? Complete Professional 1.90.0.1568 Link to comment Share on other sites More sharing options...
Sherzod Posted September 28, 2023 Share Posted September 28, 2023 7 minutes ago, theaha said: Complete Professional 1.90.0.1568 Thanks for the update. Link to comment Share on other sites More sharing options...
theaha Posted September 28, 2023 Author Share Posted September 28, 2023 1 hour ago, Sherzod said: Thanks for the update. have any solution? Link to comment Share on other sites More sharing options...
Sherzod Posted September 28, 2023 Share Posted September 28, 2023 I will check, and let you know. 1 Link to comment Share on other sites More sharing options...
Sherzod Posted September 28, 2023 Share Posted September 28, 2023 2 hours ago, theaha said: have any solution? Try this approach: procedure TUnimForm1.UnimFormReady(Sender: TObject); begin UnimFileUploadButton1.JSInterface.JSConfig('maxSize', [1000]); //bytes UnimFileUploadButton1.JSInterface.JSCode(#1+ '.addBeforeListener("change", function(a, b) {'+ ' isValid = true;'+ ' for (i = 0; i < a.getFiles().length; i++) {'+ ' if (a.getFiles()[i].size > '#1'.maxSize) {'+ ' isValid = false;'+ ' Ext.Msg.alert('+ ' "MaxSize = " + '#1'.maxSize,'+ ' a.getFiles()[i].name + ": " + '#1'.maxSizeError'+ ' );'+ ' return false'+ ' }'+ ' }'+ ' return isValid;'+ '});' ); end; 1 Link to comment Share on other sites More sharing options...
theaha Posted September 29, 2023 Author Share Posted September 29, 2023 15 hours ago, Sherzod said: Try this approach: procedure TUnimForm1.UnimFormReady(Sender: TObject); begin UnimFileUploadButton1.JSInterface.JSConfig('maxSize', [1000]); //bytes UnimFileUploadButton1.JSInterface.JSCode(#1+ '.addBeforeListener("change", function(a, b) {'+ ' isValid = true;'+ ' for (i = 0; i < a.getFiles().length; i++) {'+ ' if (a.getFiles()[i].size > '#1'.maxSize) {'+ ' isValid = false;'+ ' Ext.Msg.alert('+ ' "MaxSize = " + '#1'.maxSize,'+ ' a.getFiles()[i].name + ": " + '#1'.maxSizeError'+ ' );'+ ' return false'+ ' }'+ ' }'+ ' return isValid;'+ '});' ); end; Nice Work! Thank you. 1 Link to comment Share on other sites More sharing options...
Recommended Posts