Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sideload images not working #5

Closed
mattheu opened this issue Aug 14, 2014 · 7 comments
Closed

Sideload images not working #5

mattheu opened this issue Aug 14, 2014 · 7 comments

Comments

@mattheu
Copy link
Member

mattheu commented Aug 14, 2014

As used by press this - but I've also been using it to import images when given just the src,

Problem is that it creates a temp file and then moves it to uploads using phps rename Function so you get a notice telling you the file could not be moved

@joehoyle
Copy link
Member

@mattheu can you link me to where WordPress makes use on rename?

@joehoyle
Copy link
Member

Found it in https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/file.php#L336, I think I'll open a trac ticket to see what is said

@mattheu
Copy link
Member Author

mattheu commented Aug 18, 2014

Cool keep me updated. Keen to come up with a workaround if you can think of anything.

@joehoyle
Copy link
Member

@mattheu seems this has changed a bit in trunk, see https://core.trac.wordpress.org/changeset/29209, though judging by that code, it should be passing this check: https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/file.php#L321

    /*
     * A writable uploads dir will pass this test. Again, there's no point
     * overriding this one.
     */
    if ( ! ( ( $uploads = wp_upload_dir( $time ) ) && false === $uploads['error'] ) ) {
        return call_user_func( $upload_error_handler, $file, $uploads['error'] );
    }

I wonder why that's failing?

@joehoyle
Copy link
Member

Oh crap that, was doing the opposite that I was thinking...

@joehoyle
Copy link
Member

Created https://core.trac.wordpress.org/ticket/29257, will see what response I get

@joehoyle
Copy link
Member

I created a workaround for this which was committed to the plugin for some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants