Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
How to make a clipboard stream from guacamole-common.js.?

I am using Guacamole.client.createClipboardStream for creating a clipboard stream and send write the stream on paste event but, the remote clipboard is still empty.

const stream = client.createClipboardStream("text/plain");
stream.sendBlob(data);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I had the same issue, but then found that per the Guacamole Common Js spec, the OuputStream.sendBlob method expects a Base64 encoded string representing the blob.

Here's a little snippet from my quite early code to do this

const blobToBase64 = (blob) => {
    return new Promise((res, _) => {
      const reader = new FileReader();
      reader.onloadend = () => res(reader.result);
      reader.readAsDataURL(blob);
    });
  }

const sendBlobBasedOnMimeType = async (item, mimeType) => {
    const blob = await item.getType(mimeType);
    const blobAsDataUrl = await blobToBase64(blob);
    const blobAsB64 = blobAsDataUrl.split(",")[1];
    console.log("size of b64 blob", blobAsB64.length);
    const stream = guac.current.createClipboardStream(mimeType, "remote");
    stream.onack = () => {
      stream.sendEnd();
    }
    stream.sendBlob(blobAsB64);
  }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!