• edc1591

    (@edc1591)


    Is there any way to upload an image to wordpress that is already stored on the server? Can is use media_handle_upload() with a file that is already on the server?

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • esmi

    (@esmi)

    Thread Starter edc1591

    (@edc1591)

    Thanks, that helped me figure out how to add the file to wordpress. I just can’t seem to figure out how to attach it to a post. I have the post object, how can I attach an image to it? Thanks.

    esmi

    (@esmi)

    What’s this for?

    Thread Starter edc1591

    (@edc1591)

    users are able to generate images that are then posted to the site.

    esmi

    (@esmi)

    You’ll need to give us more than that. We need details…

    Thread Starter edc1591

    (@edc1591)

    I don’t see how that’s relevant. All I’m trying to figure out is how to attach an attachment to a post when I have the post object and the attachment id. Currently, the post appears without the image, and the image says “unattached” in the Media dashboard.

    Thread Starter edc1591

    (@edc1591)

    It looks like the problem is that ‘_wp_attached_file’ and ‘_wp_attachment_metadata’ aren’t generated for the image. How can I manually generate these?

    Thread Starter edc1591

    (@edc1591)

    OK, found the problem. I was using $post->ID for post id parameters instead of just $post. It’s working now.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Attach Local File To Post’ is closed to new replies.