{"action":"created","issue":{"url":"https://api.github.com/repos/stewartm83/angular-fileupload-sample/issues/3","labels_url":"https://api.github.com/repos/stewartm83/angular-fileupload-sample/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/stewartm83/angular-fileupload-sample/issues/3/comments","events_url":"https://api.github.com/repos/stewartm83/angular-fileupload-sample/issues/3/events","html_url":"https://github.com/stewartm83/angular-fileupload-sample/issues/3","id":127368123,"number":3,"title":"Sending/Retrieving single images to the server","user":{"login":"jdoan3","id":9904777,"avatar_url":"https://avatars.githubusercontent.com/u/9904777?v=3","gravatar_id":"","url":"https://api.github.com/users/jdoan3","html_url":"https://github.com/jdoan3","followers_url":"https://api.github.com/users/jdoan3/followers","following_url":"https://api.github.com/users/jdoan3/following{/other_user}","gists_url":"https://api.github.com/users/jdoan3/gists{/gist_id}","starred_url":"https://api.github.com/users/jdoan3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdoan3/subscriptions","organizations_url":"https://api.github.com/users/jdoan3/orgs","repos_url":"https://api.github.com/users/jdoan3/repos","events_url":"https://api.github.com/users/jdoan3/events{/privacy}","received_events_url":"https://api.github.com/users/jdoan3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-19T05:18:22Z","updated_at":"2016-01-19T17:02:35Z","closed_at":null,"body":"This is more of a question rather than an issue. For individual users setting there profile picture, I would want to return a single image that he has set rather than the list of images in the upload folder. \r\n\r\nIf I wanted to pull out a single image corresponding to the image I had uploaded only, how would I go about doing this?\r\n\r\nIn the Add method I don't see anything pertaining to the photo name that you have just uploaded how is this being sent to the server?\r\n\r\nThanks for clarification."},"comment":{"url":"https://api.github.com/repos/stewartm83/angular-fileupload-sample/issues/comments/172918573","html_url":"https://github.com/stewartm83/angular-fileupload-sample/issues/3#issuecomment-172918573","issue_url":"https://api.github.com/repos/stewartm83/angular-fileupload-sample/issues/3","id":172918573,"user":{"login":"stewartm83","id":2292198,"avatar_url":"https://avatars.githubusercontent.com/u/2292198?v=3","gravatar_id":"","url":"https://api.github.com/users/stewartm83","html_url":"https://github.com/stewartm83","followers_url":"https://api.github.com/users/stewartm83/followers","following_url":"https://api.github.com/users/stewartm83/following{/other_user}","gists_url":"https://api.github.com/users/stewartm83/gists{/gist_id}","starred_url":"https://api.github.com/users/stewartm83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stewartm83/subscriptions","organizations_url":"https://api.github.com/users/stewartm83/orgs","repos_url":"https://api.github.com/users/stewartm83/repos","events_url":"https://api.github.com/users/stewartm83/events{/privacy}","received_events_url":"https://api.github.com/users/stewartm83/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T17:02:35Z","updated_at":"2016-01-19T17:02:35Z","body":"Hi \r\n\r\nThere are many ways you can go about implementing that kind of functionality. I will give examples of how I would do it.  \r\n\r\nYou can create a folder on the file system named with the Id or name of the user, you can then save all their images into that folder with new names if you like e.g logo.png, coverpic.jpg etc. You can then retrieve the images depending on the specific user. As for uploading single images, you have to restrict them on file input control on the UI so that they can only choose one, by not setting multiple=\"true\" on the input.\r\n\r\nAnother way, the best way, is to save all image file names in a database table or some kind of storage e.g a static json file. You can then map the image files table to the users table depending on the functionality you are trying to implement in your application. This is how most content management systems like Wordpress do it. It is all mapped in a database. But you have to write the code though.\r\n\r\nI hope this helps\r\n\r\nThanks\r\n\r\n"}}