-4

I am trying to have users upload on imagine on the app I am developing for a class with Swift and posting it to my MySQL database with PHP but have no idea how to do this. I cannot find any sort of source code online for this and am at a loss for trying this myself.

Does anybody know how to do this?

halfer
  • 19,824
  • 17
  • 99
  • 186
  • No, but if I had to I would use a search engine to find out (hint, hint). `;-)` – halfer Mar 02 '15 at 23:22
  • [Possible useful link](http://iphonedevsdk.com/forum/iphone-sdk-development/67141-sending-uiimage-to-mysql.html) and [another one](http://iphoneblogsdk.blogspot.co.uk/2014/06/uploading-image-to-mysql-from-ios-using.html) from [this search](https://duckduckgo.com/?q=iphone+send+image+to+mysql). – halfer Mar 02 '15 at 23:23

1 Answers1

2

Though you can technically store images in a MySQL database, it's really bad practice.

Instead, you'll want to store the file in a disk directory. Since this is a broad question with an almost limitless amount of ways you could achieve your goal, here's one suggestion:

  1. Send the file as POST data to your server.
  2. Store the file using PHP.
Community
  • 1
  • 1
rick6
  • 467
  • 3
  • 8
  • Yes, good point about (not) storing images in a database. Once you get to a certain size, it makes the database slow in operation and backups are a pain to handle. – halfer Mar 02 '15 at 23:25