title: codename one signatueComponent image upload
body: <p>i have be trying to upload the signature captured from the codename one signature to my php server.the problem is that the image uploaded is a black image.Below is my code.how can i fix this</p>
  
  <pre><code>SignatureComponent sig = new SignatureComponent();
  sig.addActionListener((evt)-&gt; {
  try{
  img = sig.getSignatureImage();
  }catch(Exception ex){
  ex.printStackTrace();
        }
  // Now we can do whatever we want with the image of this signature.
  });
  Button sv = new Button("save");
  sv.addActionListener(new ActionListener(){
           @Override
          public void actionPerformed(ActionEvent evt) {
               try {
  
  
                  Label it = new Label();
                  it.setIcon(img);
                  orderHome.add(it);
  
                   ImageIO imgIO= ImageIO.getImageIO();
                   ByteArrayOutputStream out = new ByteArrayOutputStream();
                   imgIO.save(img, out,ImageIO.FORMAT_JPEG, 1);
                   byte[] ba = out.toByteArray();
                   MultipartRequest request = new MultipartRequest();
                   String url = Global.url1 + "upload_photo.php";
  
                   request.setUrl(url);
  
  
                       request.addData("file",ba,"image/jpeg");
                    request.addArgument("order_id", order_id);
                  request.addArgument("customer_id", customer_id);
  
                   NetworkManager.getInstance().addToQueue(request);
  </code></pre>
  
  <p>and the php code</p>
  
  <pre><code>[![image uploaded][1]][1]
  &lt;?php
  @SESSION_START();
  require_once("../includes/functions.php");
  $target_path="../uploads/";
  $customer_id=$_REQUEST['customer_id'];
  $order_id=$_REQUEST['order_id'];
  $uid = uniqid();
  $file =$uid.".jpg";
  $sucess=move_uploaded_file($_FILES["file"]["tmp_name"], $target_path.$file);                   
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/5ggxr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5ggxr.jpg" alt="image uploaded to server"></a>
  <a href="https://i.stack.imgur.com/GoZog.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GoZog.png" alt="screenshot of the simulator"></a></p>
  
  <p>the black img is the file which is uploaded to the server.the other shows the screenshot of the running app.i would like to upload the signature as shown in the screenshot</p>