Redshirt 1487 Posted August 26, 2013 Share Posted August 26, 2013 This may show my ignorance of networking... but Is it possible for a plugin to add an API endpoint that when requested would return a physical file. Thus far I've only added endpoints that return serialized json structs.If it's possible, what is needed? Link to comment Share on other sites More sharing options...
Luke 37260 Posted August 26, 2013 Share Posted August 26, 2013 Have your service implement IHasResultFactory. Then have your get method return ResultFactory.GetStaticFileResult. I may need to add some new mime types depending on what you're going to be requesting. Link to comment Share on other sites More sharing options...
Redshirt 1487 Posted August 26, 2013 Author Share Posted August 26, 2013 Books (pdf, mobi, epub) Android devices can't view windows shares natively, so I believe the only way to get them is to initiate a download over the api. I think Windows RT is also in a similar situation as they can't touch the file-system. Link to comment Share on other sites More sharing options...
Luke 37260 Posted August 26, 2013 Share Posted August 26, 2013 I don't think this endpoint should be in your plugin though as it's just a straight item downloader. That ought to go in the core. Otherwise if two plugins provide pdf's, the client has to know which plugin each one came from which seems nonsensical to me. I'll add it to the next dev build. In the meantime keep going i guess so that you can test your client side stuff. it should be easy enough to wire up. 1 Link to comment Share on other sites More sharing options...
Redshirt 1487 Posted August 26, 2013 Author Share Posted August 26, 2013 Sounds good. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now