Welcome Guest, Not a member yet? Register   Sign In
Server detects wrong file type
#1

[eluser]nigi[/eluser]
Hi Guys,

I tried to use https://github.com/blueimp/jQuery-File-Upload to upload some files to my server. This actually works on my local machine. But if try to do the same on my server get an error message telling me that the file type I'm trying to upload is not allowed. The problem is that I'm trying to upload an image test.png. In the do_upload() function $data['file_name'] gives me "test.png" but $data['file_type'] says text/plain. Is there some php.ini settings or something the like which may be the problem? I use exactly the same codeignitor configuration on the server as on my local machine. Oh yeah and when I view the raw upload request header it looks like this:

Request URL: http://myserver.com/uploader/do_upload
Request MethodTongueOST
Status Code:200 OK
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
Content-Length:79970
Content-Type:multipart/form-data; boundary=----WebKitFormBoundary8j2RVFp4CsAJrwER

X-Requested-With:XMLHttpRequest
Request Payload
------WebKitFormBoundary8j2RVFp4CsAJrwER
Content-Disposition: form-data; name="userfile"; filename="test.png"
Content-Type: image/png


Thanks for any thoughts.
nigi
#2

[eluser]InsiteFX[/eluser]
If you are running on a live sever most do not install all the mime types!

I can add mime types on my server through CPanel.

Or you will need to get the tech support to add them for you.
#3

[eluser]nigi[/eluser]
Ok thanks. My control panel says the type is in there: image/png png

I just emailed my tech support so hopefully they will know what to do.

Thanks.
#4

[eluser]InsiteFX[/eluser]
./application/config/mimes.php
#5

[eluser]nigi[/eluser]
yeah but it seems to be ok there. The problem really seems to be in the server configuration because even mime_content_type("plus.png") returns text/plain instead of image/png.




Theme © iAndrew 2016 - Forum software by © MyBB