GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV Mobile 2024
→
Send photos from android to php webservice
Send photos from android to php webservice
Iniciado por marcov, set., 05 2022 4:08 PM - 2 respostas
Conecte-se…
marcov
#1
Membro registado
53 mensagems
Publicado em setembro, 05 2022 - 4:08 PM
I am trying to send a photo from android to a webservice, I tried both saving the photo in hfsql, and taking it from the directory
test with paht:
sTipoRic is string
sTest is string =QRY_Photos.Path
sFoto is string = CompleteDir(fCurrentDir()) + sTest
vRequest is Variant
sTipoRic = "Add"
vRequest.Tipo_Ric = sTipoRic
vRequest.Descrizio = "test123"
vRequest.Image = Encrypt(fLoadBuffer(sFoto),"",cryptNone,encodeBASE64NoCR)
cMyRequest is httpRequest
cMyRequest.URL = "
http://1xxxxx
" // SERVER PRODUZIONE
cMyRequest.ContentType = "application/json"
cMyRequest.Content = VariantToJSON(vRequest)
cMyRequest.Method = httpPost
cMyResponse is httpResponse = HTTPSend(cMyRequest)
test with db
bufFotobuf is Buffer =QRY_Photos.Photo
sFoto is string = Encode(fLoadBuffer(bufFotobuf), encodeBASE64)
Denunciar
0
0
marcov
#2
Membro registado
53 mensagems
Publicado em setembro, 07 2022 - 4:12 PM
hi,
i solved the problem, it was not the client but the server, for some reason the php base64_decode is not compatible with windev encode
Denunciar
0
0
marcov
#3
Membro registado
53 mensagems
Publicado em setembro, 07 2022 - 5:50 PM
hi,
I rectify everything works correctly.
before inserting the file into mysql in php:
$ fileName = addslashes ($image);
Denunciar
0
0
→ Voltar para WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto