Hi,

Detect the problem by including the following parameters:
             mp.setFilename ("image", "data.jpeg");
             mp.setPost (true);

However, I would like to know how I can send 2 additional arguments 
(Database and Company Number).

Thanks


El Tuesday, June 29, 2021 a la(s) 6:37:59 PM UTC-5, [email protected] 
escribió:

> Hi,
>
> I am working on a WS made in PHP. I was able to create some routines to 
> receive an image and save them in a folder on the server. All this I have 
> been testing in Postman and it works 100%.
> In the WS I do not validate the HTTP method, but I assume it is POST.
>
> From my mobile app I send the file with the MultipartRequest class. I was 
> able to validate by debugging the response code 200, however I can't get 
> the file to be created in the folder.
>
> I have 3 days struggling with this and I don't see the problem. I copy the 
> code to see if you can see the error.
>
> I take this opportunity to ask if it is valid to send additional 
> arguments, since I need to send the name of the database and the company 
> code to create the folder where the image will be saved.
>
> My code:
>     public static void actualizaImagenFoto(String rutaImagen, Long 
> visitaId) {
>         try {
>             MultipartRequest mp = new MultipartRequest();
>             mp.setUrl(SERVER_URL + "ws_foto_imagen/ws_foto_imagen.php");
>  //           mp.addArgument("token", UsuarioService.getToken());
>  //           mp.addArgument("fot_visita_id", visitaId.toString());
>             mp.addData("imagen", rutaImagen, "image/jpeg");
>             addToQueue(mp);
>             System.out.println(Integer.toString(mp.getResponseCode()) + "  
>  " + mp.getResponseErrorMessage());
>         } catch (IOException err) {
>             Log.e(err);
>             ToastBar.showErrorMessage("Error en actualización de la foto: 
> " + err.getMessage());
>         }
>     }
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/bdc6ed3f-595e-4249-ba63-d75a4fc05ea9n%40googlegroups.com.

Reply via email to