0

Hi to you all.
I am working on an application that accepts various source files from the users and stores them on the server with the appropriate extension e.g (.cpp, .py).
This has been working fine as php allows a programmer to check the type of the uploaded file type using

$_FILES['my_file']['type']

variable. For c++ files they are identified as 'text/c++src', C source files are identified as 'text/csrc' and so on. Therefore getting the file extension to use when storing the file is quite easy.
Firefox works fine but when using a different browser (opera 9.0 to be specific) php identifies all the source files as 'application/octet-stream' therefore my program treats the file as an unknown one and gives it a general extension.
So my question is, "Does the browser have an effect on the type of a file uploaded?"
Happy times

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by sureronald
1

So my question is, "Does the browser have an effect on the type of a file uploaded?"

Yes because if you go into the Opera preferences you will see that Opera will only recognize web related mime types. Other mime types are not programmed into Opera where as a browser like firefox may use the windows file system to recognize file types.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.