This code snippet illustrates how you can upload a file preferably an image from angularjs frontend to slim php server
1. Write a simple form for the user to upload filE
Take note of file-model directive that assists us to upload the image
This is the angularjs directive that process the file. You don’t have to change anything here
Angularjs factory that allows us to send data to the server. Make sure you specify the headers as i have set and don’t forget the transform request otherwise it wont work..
Do display the image. Just call the api and display it as follows