I’m about to code my first API for my codeigniter application (Using the popular REST library), but I couldn’t find a way to let users upload and download my application’s images through the API. How is it usually done in API’s?
I appreciate your help. 🙂
API uploads or downloads are done the same way whether you have a web application or a web service. You must use a
multipart/form-datain a POST request for uploads, and send the proper response headers in downloads. In short, the PHP manual on file uploads and say,readfilefor downloads, still applies for APIs.