Welcome Guest, Not a member yet? Register   Sign In
Image upload - file type not allowed!?
#1

[eluser]Unknown[/eluser]
Hiya,

I am using code igniters file upload class to add jpgs, gifs and pngs to my site cms. I have follwed the tutorial set out in the user guide here to the letter and I am getting the error message that the file type I have chosen is not allowed even though it clearly should be.

I have tested this on another computer and got it working fine, however when uploaded to the server it does not work. The only thing I have done differently is that I am using a .htaccess file to remove the ‘index.php’ from my URI.

This is my .htaccess code which I got from the codeigniter wiki and which works fine
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>

Has anyone had this problem as well or if anyone can suggest a solution it would be greatly appreciated.

Thanks
#2

[eluser]Rick Jolly[/eluser]
I had the same problem with jpegs until I added a mime type. I'm not sure if you're having the same problem, but you might want to look at this:
http://codeigniter.com/bug_tracker/bug/1935/

If the fix works for you, then you might want to add a comment to that bug report so that it might get confirmed.
#3

[eluser]Jamongkad[/eluser]
Could we see a snippet of your code? perhaps we could find something there.
#4

[eluser]Roger Glenn[/eluser]
I was getting the same filetype error when uploading JPG's, although the file was actually uploading successfully. After adding the additional 'image/jpg' element to the jpeg, jpg and jpe mime types as suggested in http://codeigniter.com/bug_tracker/bug/1935/ the system stopped throwing the error.




Theme © iAndrew 2016 - Forum software by © MyBB