title: Saving jpg file with cloud-code Parse-Server
body: <p>I'm trying to save jpg files with cloud code on parse server ...</p>
  
  <p>On Android I can do it using this way</p>
  
  <pre><code>Bitmap bitmap = ((BitmapDrawable) myImageView.getDrawable()).getBitmap();
  
  ByteArrayOutputStream stream = new ByteArrayOutputStream();
                      bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
                      byte [] byteArrayPhotoUpdate = stream.toByteArray();
                      final ParseFile pictureFileParse = new ParseFile( newUserInfo.getObjectId() + ".JPEG",byteArrayPhotoUpdate);
  
       newUserInfo.put("profile_picture",pictureFileParse);
       newUserInfo.saveInBackground();
  </code></pre>
  
  <p>But I have no idea how to do this in the cloud code. I call my cloud code functions like this</p>
  
  <pre><code>HashMap&lt;String, String&gt; params = new HashMap();
  
  ParseCloud.callFunctionInBackground("myCloudFuncion", params, new FunctionCallback&lt;String&gt;() {
           @Override
            public void done(String aFloat, ParseException e) {
  
                  }
              }); 
  </code></pre>
  
  <p>but I have no idea how to pass a bitmap in hashmap params.
  I already searched the internet, but nothing that I found in helped, the links that refer to something useful, is already old and outdated, from the epoch of the old parse ...</p>
  
  <p>In <a href="https://docs.parseplatform.org/js/guide/#files" rel="nofollow noreferrer">parse docs</a>  I found this</p>
  
  <pre><code>    var base64 = "V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE=";
      var file = new Parse.File("myfile.txt", { base64: base64 });
  </code></pre>
  
  <p>Which made me confused because I do not know if the 2 "base64" parameters refer to variable or base64 type</p>
  
  <p>Should I convert my bitmap to base64 and send it as parameter to the cloud code?</p>
  
  <p>If you have been through this and know how, I will be very happy to know your solution.
  Thank you!</p>