Question

When uploading a file to an FTP server it always defines the mime type as the file extension that the name is. Is there any way to change the mime type that the file is being uploaded as?

EX: If I am uploading Hi.php to the URL /Hi.bz2 it doesn't run the .php script at all and just reads it as plain text

Était-ce utile?

La solution

FTP has no idea of a MIME-Type. But the HTTP server, which serves the file later needs some way to determine the type of the file and the usual way for static files is to look at the files extension. It it the same way most system determine the type of the file when they need to know the responsable application.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top