PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
Send photos from android to php webservice
Send photos from android to php webservice
Started by marcov, Sep., 05 2022 4:08 PM - 2 replies
Connect yourself…
marcov
#1
Registered member
54 messages
Posted on September, 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)
Report
0
0
marcov
#2
Registered member
54 messages
Posted on September, 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
Report
0
0
marcov
#3
Registered member
54 messages
Posted on September, 07 2022 - 5:50 PM
hi,
I rectify everything works correctly.
before inserting the file into mysql in php:
$ fileName = addslashes ($image);
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text