0

I have a problem with my application, and I was wondering if you guys could help.

So, I am making an application that communicates with a server that contains a SQL database. I am going to store a link of the user profile picture in the database. However, I want the pictures to be stored on my server - ubuntu server on raspberry pi 2. I've been looking around, but I cannot find a good tutorial on how to upload a file to the server at a specific location. So basically, I want to take a bitmap file, and then send it to my raspberry pi.

I would really appreciate it if someone could help me out. Thanks!

Pranav
  • 143
  • 1
  • 5

1 Answers1

0

You can convert your file to a base 64 string and then send it

refer to this solution: Android - Send Image file to the Server DB

Community
  • 1
  • 1
TootsieRockNRoll
  • 3,218
  • 2
  • 25
  • 50
  • do you mean literally saving the string into the sql db? – Pranav May 10 '15 at 20:50
  • umm no, but you can decode the string, save the file on your server, and store the link to it, this would be easier for later use on the mobile side also – TootsieRockNRoll May 10 '15 at 21:00
  • This is basically what I want to do right now, but what I do not know is how to save the string as a file to the server – Pranav May 10 '15 at 21:10
  • I'm no expert on web/server side apps, but it's a base64 String which you won't have problems with on any langage you're using, just search for something like 'decode base64 string to file using XX' (your langage) – TootsieRockNRoll May 10 '15 at 21:20
  • What I really want to know is: How do I take the base64 string and store it into a folder on my server? – Pranav May 10 '15 at 21:42
  • you probably want to save it as an actual file and only store the link to it, on the device it's easier to get the link than the whole base64 string – TootsieRockNRoll May 10 '15 at 21:46