Title: Image upload Script
Last modified: August 19, 2016

---

# Image upload Script

 *  [Jorge A. Gonzalez](https://wordpress.org/support/users/nasium/)
 * (@nasium)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/image-upload-script/)
 * I have a routine that is inserting my old content into WordPress, each old post
   has an image associated with the post and I have them stored on the file system
   that I can access via POST_ID.
 * My question is how can I get these images in the media library?
 * I don’t want to do this manually, so I want to use the WP API. Is there a script
   out there that can do this for me?
 * Here is what I would need the script to do:
 * – hand the script a post_id & file location, upload and create a thumbnail
    –
   the image should be associated with the post in the media library

The topic ‘Image upload Script’ is closed to new replies.

## Tags

 * [image](https://wordpress.org/support/topic-tag/image/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)
 * [upload](https://wordpress.org/support/topic-tag/upload/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Jorge A. Gonzalez](https://wordpress.org/support/users/nasium/)
 * Last activity: [17 years, 10 months ago](https://wordpress.org/support/topic/image-upload-script/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
