ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Trouble using image upload

October 22, 2011 2:01pm

Subscribe [3]
  • #1 / Oct 22, 2011 2:01pm

    James Hurst

    48 posts

    We have upgraded our build of EE to

    v2.3.0
    using structure.

    While testing locally we’ve been able to add image to the site, and have migrated the site to the live server. However now if we try and upload an image to the site using the file manager we have a problem. After the image uploads the file manager window shows an error that reads:

    A Database Error Occurred
    Error Number: 1062

    Duplicate entry ‘0’ for key 1

    INSERT INTO `exp_files` (`upload_location_id`, `site_id`, `file_name`, `mime_type`, `rel_path`, `modified_by_member_id`, `uploaded_by_member_id`, `file_size`, `file_hw_original`, `field_1_fmt`, `field_2_fmt`, `field_3_fmt`, `field_4_fmt`, `field_5_fmt`, `field_6_fmt`, `modified_date`, `status`, `title`, `upload_date`) VALUES (‘1’, ‘1’, ‘max_cooper_ep_22.jpg’, ‘image/jpeg’, ‘/srv/curestudio.com/public/htdocs/images/uploads/max_cooper_ep_22.jpg’, 1, 1, 711178.24, ‘997 980’, ‘xhtml’, ‘xhtml’, ‘xhtml’, ‘xhtml’, ‘xhtml’, ‘xhtml’, 1319305303, ‘o’, ‘max_cooper_ep_22.jpg’, 1319305303)

    Filename: models/file_model.php

    Line Number: 229

    I’ve checked the server path in the image upload settings, which seems to be correct, and the directory permissions for the image folder and thumbnail folder are both set to 777.

    The images are being uploaded to the server and i’ve tried a few different files and the error is being thrown everytime (and we can’t use the images in our posts)...

    Anyone got any advice?

  • #2 / Oct 24, 2011 8:05am

    James Hurst

    48 posts

    Is there anyone from Ellis Lab out there? Can you let us know how we should resolve this, it is getting quite urgent -

    Many thanks -
    James

  • #3 / Oct 24, 2011 11:25am

    Mark Bowen

    12637 posts

    Hi James,

    Is this an existing site that you have upgraded to 2.3.0 and if so did you have any errors when updating it?

    If there were errors can you please let us know what they were.

    Thanks,

    Mark

  • #4 / Oct 24, 2011 11:43am

    James Hurst

    48 posts

    Hey Mark - yes it was an existing site, but there weren’t any errors that I came up during the update. It was updated locally, and we then re-deployed it to a different server (we were migrating the server, which was the reason we went in for the upgrade when we did) - so it is on a different server if that could of caused anything?

    J

  • #5 / Oct 25, 2011 5:25am

    James Hurst

    48 posts

    Hey Mark (or any other Ellis lab’ers out there) any news on this please?

    James

  • #6 / Oct 25, 2011 12:01pm

    Mark Bowen

    12637 posts

    Hi James,

    When you deployed the site to the new server did you just import the current database and upload the files or did you use some sort of process such as GIT?

    If you create a new file upload location does that work correctly as you would expect?

    Thanks,

    Mark

  • #7 / Oct 25, 2011 12:57pm

    James Hurst

    48 posts

    Hey Mark - not using GIT (or any other deployment process)

    Created a new DB / imported it from our local environment.
    Copied over the files and updated config / Database settings (and a few plug in settings including ImgSizer that needs to know the basepath on the webserver if thats useful)

    I have created a new image upload directory - and tried to upload an image to that directory - but am given an error message that says:


    An Error Was Encountered
    You are not authorized to access this page


    with a back button. It doesn’t upload the image -

    Does that help?

    Thanks for your help!

    Ta
    J

  • #8 / Oct 26, 2011 10:49am

    Mark Bowen

    12637 posts

    Hi James,

    Do you have any other member groups in this install that you could try this with or are you using the main super admin account here?

    If not the main super admin account then check that the group has permissions to use the file manager.

    Check for Members > Member Groups > Edit Group (Name of group trying to upload files) > Control Panel Access > Can Access CONTENT: File Manager is set to Yes.

    Thanks,

    Mark

  • #9 / Oct 26, 2011 10:50am

    James Hurst

    48 posts

    Hi Mark - i’m using the super admin account -
    J

  • #10 / Oct 26, 2011 10:57am

    James Hurst

    48 posts

    Although worryingly - i’ve just looked at the ‘members’ list and there are three registered ‘members’ that look like some sort of spam / injection. I’ve gone back to look at the build locally, and there were two on there (but a third has crept in) - is something you’ve experienced before? Mysterious members being added?

  • #11 / Oct 27, 2011 10:46pm

    Dan Decker

    7338 posts

    Hi James Hurst,

    Let’s get your first issue worked out, then we can have a go at ways you can mitigate spam users and such. When you moved your site, did you make sure to follow the outline here. It provides a list of places to verify your paths. Can you verify that all of your paths on the new server are set correctly?

    Cheers,

  • #12 / Oct 28, 2011 1:27pm

    James Hurst

    48 posts

    Hi Dan - I have checked all the paths, and they all look fine. I’ve tried to create another image upload directory but when I add the server path and URL into the settings I’m given the following error, if that helps shed any more light onto the situation:

    A Database Error Occurred
    Error Number: 1062
    
    Duplicate entry '0' for key 1
    
    INSERT INTO `exp_upload_prefs` (`name`, `server_path`, `url`, `allowed_types`, `max_size`, `max_height`, `max_width`, `properties`, `pre_format`, `post_format`, `file_properties`, `file_pre_format`, `file_post_format`, `cat_group`, `site_id`) VALUES ('Images 3', '/srv/curestudio.com/public/htdocs/images/uploads_3/', 'http://curestudio.com/images/uploads_3/', 'img', '', '', '', '', '', '', '', '', '', '', '1')
    
    Filename: controllers/cp/content_files.php
    
    Line Number: 2405

    Every time I click submit - i’m shown this error, when I refresh the page it shows me the file upload pref/ dialogue box, without the additional server location details that i’m trying to enter…

    Anything you can do much much appreciated - i’m thinking of starting over again and re-deploying the site from scratch…

    James

  • #13 / Oct 29, 2011 5:48pm

    Dan Decker

    7338 posts

    James Hurst,

    Is the site on a server that we would be able to access? If so, be on the lookout for an email from me.

    Cheers,

  • #14 / Nov 07, 2011 1:02pm

    Dan Decker

    7338 posts

    Hi James Hurst,

    Thanks for working with us in private on this. If you need any further assistance, please let us know in a new thread.

    For the edification of the rest of the community, James’s issue boiled down to compatibility mode in his database export and the use of compression. After some testing to determine the correct compatibility mode and turning off compression, James was able successfully complete the import after disabling compression in his export.

    Cheers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases