Recent

Author Topic: Upload picture to rest server  (Read 368 times)

juank1971

  • Jr. Member
  • **
  • Posts: 62
Upload picture to rest server
« on: September 06, 2020, 04:29:20 pm »
how can i upload a picture  to rest server

mr-highball

  • Full Member
  • ***
  • Posts: 211
    • Highball Github
Re: Upload picture to rest server
« Reply #1 on: September 06, 2020, 04:42:04 pm »
Lots of ways, depends on how you want to do it. One way could be base64 encode the image and perform a POST with the contents in the body. Your rest server could then either decode and store on the filesystem, or store "as is" in some database.

jmpessoa

  • Hero Member
  • *****
  • Posts: 1623
Re: Upload picture to rest server
« Reply #2 on: September 06, 2020, 07:30:05 pm »
Quote
One way could be base64 encode the image....

You can use jBitmap [methods] component to support  base64 encode:

GetBase64StringFromImage
GetBase64StringFromImageFile
GetImageFromBase64String

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

juank1971

  • Jr. Member
  • **
  • Posts: 62
Re: Upload picture to rest server
« Reply #3 on: September 06, 2020, 10:10:27 pm »
very simple thanks :D

 

TinyPortal © 2005-2018