0

I realise that this is quite a broad question, so any general guidance would be helpful.

I have an app, whereby data is downloaded from a sever, and displayed in a table view. Each entry to the tableview also has a picture associated with it. This is where i'm stuck. Do I somehow store the image on my FTP server, and include a link to the image? Or do I directly store the image in the database? Are there any tutorials explaining how to do this?

4

3 回答 3

1

I would say store image path as I'd image file system access to be faster than database.

Read what Facebook do/say.

于 2012-10-27T14:12:40.877 回答
1

You can either store the path to your file as a VARCHAR field, but then have to verify the data really exists (someone might have deleted the file and the record in the DB won't indicate that), or you store the image itself as a BLOB field.
The 2nd approach is more consistent, but makes the DB larger and make you handle BLOB fields. I'd go with the 1st one unless you really need to store the image in the DB.

于 2012-10-27T14:15:22.470 回答
1

The best way to do this will be storing images path in database, because it is good performance wise and gives you more control over it when you work with directories.

于 2012-10-27T14:47:15.963 回答