Title: Upload image via URL with code
Last modified: August 20, 2016

---

# Upload image via URL with code

 *  Resolved [Wes](https://wordpress.org/support/users/therealwesfoster/)
 * (@therealwesfoster)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/upload-image-via-url-with-code/)
 * I’m creating a plugin, so this topic is pertaining to code, not the in-admin 
   media uploader.
 * I’m trying to upload an image to a post from an URL. I don’t really know where
   to start. It looks like all the functions I’ve found deal with uploading files,
   not necessarily loading from an external URL.
 * I’ve saved images from an external source with PHP before by using fopen, however
   I’m needing to update the post and DB correctly so I would like to use a WP function,
   or for someone to let me know what I can do to create the function needed.
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Wes](https://wordpress.org/support/users/therealwesfoster/)
 * (@therealwesfoster)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/upload-image-via-url-with-code/#post-2233358)
 * Bump. Anyone?
 *  [JakeElder](https://wordpress.org/support/users/jakeelder/)
 * (@jakeelder)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/upload-image-via-url-with-code/#post-2233495)
 * [http://codex.wordpress.org/Function_Reference/media_sideload_image](http://codex.wordpress.org/Function_Reference/media_sideload_image)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Upload image via URL with code’ is closed to new replies.

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [JakeElder](https://wordpress.org/support/users/jakeelder/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/upload-image-via-url-with-code/#post-2233495)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
