Hi Guys,
Sorry if this is not the proper thread but it was the closest I could find...
I have an image picker that lets users choose from the roll or take a picture. I resize and compress the image to bring it down to a quite reasonable size yet still looks good for my purposes.
I need to upload these images to my app server in AWS.
To that end, I'm thinking to convert the image to NSData and then do:
NSString *imageAsString = [mageData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];and via AFNetworking upload that as JSON.
So, Question 1, does that seem reasonable or is there a better approch I should be considering?
Presuming all goes well as above...
Question 2, how do I store the image on the server side?
My app server talks to a MySQL instance also in AWS so I am thinking about simply storing the the deserialized string in a table with other facts like company name, address, city and so on.
Having done some reading though, a lot of folks say storing image data in a db is a bad idea and instead I should store urls to the actual location of the image and return those to the client for them to download the actual images. What's never clear is where they store these images. If I were going to go this route I would probably leverage Amazon S3 or SimpleDB as opposed to the file system under a web server (which I don't have nor want) approach they seem to be sort of calling for. In general it seems this approach is geared more towards web sites rather than mobile apps but perhaps my understanding is incomplete.
Users are also able to download photos, so ideally on the server side I would like to be able to do a SELECT on a table and get the geographic data as well as the deserialized string from JSON but since the image string is base64 that's not going to work as the other data is UTF8...
Any and all help would be greatly appreciated!
Thank You!