# Uploading 17500 users and their avatars using PHP

**URL:** <https://meta.discourse.org/t/uploading-17500-users-and-their-avatars-using-php/71685>\
**Category:** Development\
**Created:** [9. Oktober 2017 um 14:39 UTC](https://meta.discourse.org/t/uploading-17500-users-and-their-avatars-using-php/71685 "2017-10-09T14:39:06Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Frank\_Bailey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frank_bailey/32/83927_2.png) [@Frank\_Bailey](https://meta.discourse.org/u/Frank_Bailey)\
**Post date:** [9. Oktober 2017 um 14:39 UTC](https://meta.discourse.org/t/uploading-17500-users-and-their-avatars-using-php/71685/1 "2017-10-09T14:39:06Z")

</div>

I have been tasked with moving a Ning community of 17500 users to Discourse. I have gotten the user adding part working using a modified version of the Discourse API for PHP from here `https://github.com/communiteq/discourse-api-php`.

I plan to parse in the full 17500 users and then work on them one at a time, looping through with a `foreach` statement.

The sticking point is that there isn’t a clear example of how to upload each user’s avatar (present on my local disk) to the API using the `uploads.json` endpoint. I see how it can be done if the file is uploaded through a standard browser upload, but the mechanism of using a file loaded from disk programmatically in PHP instead of a browser upload is eluding me.

If anyone can offer any advice on this issue I would appreciate your help enormously. Thanks!

---

_[View the full topic](https://meta.discourse.org/t/uploading-17500-users-and-their-avatars-using-php/71685)._
