Can I transfer files with a charging cable?

Not always. Some cables are designed for charging only. If you need to transfer files, check that the cable supports data transfer as well as charging.