Set proper metadata from file.