Asking an editor about supplementary files to avoid journal overlength?
Some journals allow supplementary material, while others do not.  The first thing to do is to check whether supplementary material is routine for the journal that you are submitting to.  If so, then you may not even need to write to the editor, if your planned use of supplementary material will be like many other papers in the journal.

If supplementary material does not appear to be routine, then it's entirely reasonable to write to the editor handling your paper and ask.  A short and simple query is fine, much along the lines of the question here.  Do this as quickly as possible, however (so that you don't end up in a last-minute panic) and be prepared that you may be told no.