php - How to keep private images private -
i have users in api service authenticating oauth, via web client (website).
when user requests private profile images.. how should these served up? see few options few drawbacks , unsure what's best decision going forward.
1) host images hashed name... eg (~/public/folder/309dsfas928f39rjkfe93.jpg
)
pro - simple, keeps assets centralized apigility based server. con - nothing preventing finding image .. no of assuring access control once url found.
2) pass img data in json request
pro - you're assured person receiving image has permission.. every time image accessed con - images need stored (temporarily?) on webclient's server.. - images traveling in json seems wrong me
are there datastreaming options instead? thank you
nice question!
right have solution pass image in base64
encoded sting in json response. works nicely , on client side can paste string in src
tag of html image. when comes workflow smooth.
but guess others might have solution :p
Comments
Post a Comment