Upload image or file from smart device in GeneXus

985 views Asked by At

How to upload an image or PDF files from smart devices to a specific folder on the server?

2

There are 2 answers

0
Marcos Crispino On

You could create a Procedure object that receives an Image (images only) or a BlobFile (for any file type).

This Procedure will be exposed as a REST service when called from a mobile app, and the file upload will be performed automatically.

Then, with the image or PDF file already in the server, you can move it to the folder you want.

0
Chicken Choker On

A lil' too late for an answer but I was recently facing this one problem and solved by passing the image forward to the procedure and receiving as a blob data type.

Next I did the following:

parm(in:&blob)
&File.Source = &blob.ToString()
&File.Copy('path/to/file.jpeg')
&HTTPClient.AddFile('path/to/file.jpeg')

Hope it still serves you