Taking file extension from url path or content type. Dumping files in a subfolder