Hello,
how can I upload an image with an xdata service?
I'd like to have something like this interface
[httpPOST]function UploadImage(Image: sometype): TJsonObject;
where sometype is a type I do not know.
For "normal" post-functions I use something like
[httppost]function DoSomething(param: Integer): TJsonObject;
or
[httppost]function DoSomething(param: TSomeType): TJsonObject;
and transfer the object as JSON Object. But what type can I use for a file upload from a web form via POST?
- <form action="https://myserver/UploadImage" method="post" enctype="multipart/form-data">
- <input type="file" name="fileToUpload" id="Image">
- <input type="submit" value="Upload Image" name="submit">
- </form>
Do You have any advice? What enctype do I use and how can I get the data in my service function?
Kind regards
Harald