Fix extension gussing

If UploadedFile instance we must get the extension a different way. This makes it so that the file provider has a correctly named extension.