Does anyone have any examples of posting files to the local storage? The documentation in the Git Wiki is shall we say, a tad light:-
https://github.com/dreamfactorysoftware/dsp-core/wiki/File-Storage-Services
I’m trying to create an area for users to upload an image to use as a profile picture using the ng-flow extension.
How does the DSP govern permissions for each container/directory/file too?
Thanks
Jason
September 8, 2014, 11:04pm
2
2 headers required with a file upload, here’s the jquery way ->
$.ajax({
beforeSend: function(request) {
request.setRequestHeader("X-File-Name", file.name);
request.setRequestHeader("Content-Type", file.type);
},
type :'POST',
url :{yourdspurl}/rest/files/{container}/{file_path} createFile()
data: yourfile,
cache:false,
processData: false
});
Security is at the container level currently, not down to the folder/file level.
Documentation forthcoming.
1 Like
Hey Antony, Ben here. If you need visibility control of the image at the file level (e.g. user can only see his own image), one option would be to store the image in the db and use record-level permissions to enforce that rule.
Jason
September 9, 2014, 5:32pm
4
Thanks for the help guys, I was planning on tackling this today and @Jason your example is the cherry on top!
HI Ben!
The link that you posted isn’t working anymore. Would there happen to be another example link similar?