Get URL File

Hi Can I get file by url link in method? I don't know code how to write Another question is system get url file how to auto attachment in relationship.