1

I want to send the doc and pdf file to the MySQL database using php from my android application. I have no idea about it. What shoud i write in android and php file?

Please guide me if anyone have code?

Thanking you.

Ram Mansawala
  • 652
  • 7
  • 22
  • Have you thought about saving file in some folder and store in DB path to the file? – Boban S. Apr 10 '14 at 08:34
  • Have you thought about using google to ask that question? – arkascha Apr 10 '14 at 08:35
  • No, i just want to select file into my app and send/save to MySQL databse. I have no idea about should i make folder for saving file or not? – Ram Mansawala Apr 10 '14 at 08:41
  • u need to make folder and u just save the file name in the database. and when u select the file which u want to save u need to move the file to ur created folder. Like this i did it in php – W I Z A R D Apr 10 '14 at 08:47

1 Answers1

3

You have two options:

1) Store it in a field with a BLOB data type. I really do not advise this in any way and is only listed as the first option because it pertains directly to your question.

SO has good coverage of this already Storing files in SQL Server

2) Move the file to a folder and store the file path. This is the preferred option by mmmm everyone. Use move_uploaded_file and if you are unsure of how to setup an html form take a look at W3C PHP File Upload

Community
  • 1
  • 1
Ne Ma
  • 1,719
  • 13
  • 19