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/30161d2f-46a7-4144-977e-0d6bf8d9798bn%40googlegroups.com.

Reply via email to