I am trying to upload a file to local file storage using the standard API setup by the Dreamfactory install. Currently, I’m using the cloud version of the API.
Admin Application Version: 2.0.5
DreamFactory Version: 2.0.2
My application is an AngularJS app that uses the API for login (the accounts were setup in the Users interface in DF). Here are my steps:
- Created the App in DF
- Created the roles in DF and gave access to the necessary API. In this case, I gave the admin role files/, files/sub_dir/, and files/sub_dir/ access
- Created the users, one I assigned admin access, the other is just a plain user, which only has access to login and GET files
- Setup CORS for all domains to make sure it was accessible.
I am using an angularjs upload plugin (https://github.com/danialfarid/ng-file-upload), but also viewed the link here which is very similar: https://github.com/dreamfactorysoftware/dsp-core/wiki/File-Storage-Services.
So i am able to login just fine with both accounts, but keep getting a 403 forbidden error when I attempt to upload a file. I am sending the session token in the header after login using X-Dreamfactory-Session-Token and I’ve also tried just sending in the app name both in the header with X-Dreamfactory-Application-Name and also as a query string. No dice.
The endpoint is in format: http://myserver/api/v2/files/{container}/
Any ideas what I am doing incorrectly?