You can use the standard multipart upload. It works like a standard HTML 
form with file field so should be pretty easy to process on the server side:
https://www.codenameone.com/javadoc/com/codename1/io/MultipartRequest.html

On Tuesday, May 11, 2021 at 5:29:10 AM UTC+3 [email protected] wrote:

>
>  browse.addActionListener((evt) -> {
>             Display.getInstance().openGallery(new ActionListener() {
>                 public void actionPerformed(ActionEvent ev) {
>                     if (ev != null && ev.getSource() != null) {
>                         String chemin = (String) ev.getSource();
>                        
>                         int index = chemin.lastIndexOf('/');
>                         if (index > 0) {
>                             filename = chemin.substring(index + 1);
>                             System.out.println(filename);
>                             try {
>                                 Image img = Image.createImage(chemin);
>                                 ImageViewer a = new ImageViewer(img);
>                                 content.add(a);
>                                 
>                             } catch (IOException ex) {
>                             }
>                         }
>                     }
>                 }
>             }, Display.GALLERY_IMAGE);
>         });
>
> here's the code i'm having 
> Le mardi 11 mai 2021 à 03:27:34 UTC+1, Mohamed Melek CHTOUROU a écrit :
>
>> Hi everyone, i'm a begginer and i'm trying to openGallery to select an 
>> image, then show it in a ImageViewer, then send it through php to my 
>> localhost
>> So far i opened the gallery and selected the image ... but i have no clue 
>> on how to show it and send it, any kind help ?
>>
>

-- 
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/3d8cbf45-2db6-4488-b33f-2898fcc026e2n%40googlegroups.com.
  • [codenameone-discussi... 'Mohamed Melek CHTOUROU' via CodenameOne Discussions
    • [codenameone-dis... 'Mohamed Melek CHTOUROU' via CodenameOne Discussions
      • [codenameone... Shai Almog
        • Re: [cod... 'Mohamed Melek CHTOUROU' via CodenameOne Discussions
          • Re: ... Hannah R
            • ... 'Mohamed Melek CHTOUROU' via CodenameOne Discussions
              • ... 'Mohamed Melek CHTOUROU' via CodenameOne Discussions

Reply via email to