Add js callback before file insert