Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6773477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:40:22+00:00 2026-05-26T15:40:22+00:00

Background: I’m developing an HTML5 webapp for my company which is basically a Rich

  • 0

Background:

I’m developing an HTML5 webapp for my company which is basically a Rich Text Editor (similar to Google Docs) that stores information in a database.

We are using CKEditor 3 as richtext editor and Jquery to acomplish this.

We’ve chosen Google’s Chrome as the preferred browser.

Our app is currently in alpha testing period, having a group of 18 tester (which are the same ones that will use the app). These people is heterogeneous, but almost all of them of them have basic computer skills, mostly limited to MS Word and MS Excel.

.

Problem:

Most of our users still use word to elaborate the document, mainly due to its capacity of generating rich flowcharts. When they copy/paste the generated content to Chrome, images are pasted as link to a local file (auto generated by the OS, in a users/*/temp folder). This means the server can’t access these files and the resulting documents (generated PDFs) don’t contain the images.

.

Question

How can I force pasted images to be encoded in base64, similiar to what happens in Firefox?

.

Notes

If it’s possible to “upload” to server an image referenced as src=”file://c:\something”, that would solve my problem as I can base64 encode that image later.

We can’t switch to firefox since it doesn’t fully solve our problem (if an image is “pasted” alongside with text, firefox doesn’t base64 encode it) and raises other issues such as an horizontal scrollbar appearing when the text is too long to fit in the textarea.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:40:23+00:00Added an answer on May 26, 2026 at 3:40 pm

    Yes and no I believe.

    It is possible to intercept the paste event and fetch the pasted image as a file, then use FileReader to read the file as a Data URI (base 64 encoded PNG).

    However, Word seems to send a reference to a local file, which generates a security exception (at least on Chrome) because of a cross-domain request (http://... and file:///...). As far as I’m concerned there is no way to get the actual contents of such local files, and the contents are not sent as clipboard data itself.

    If you copy a “pure” image (e.g. out of Paint), you can get the base 64 encoded data as follows: http://jsfiddle.net/pimvdb/zTAuR/. Or append the image as a base 64 encoded PNG in the div: http://jsfiddle.net/pimvdb/zTAuR/2/.

    div.onpaste = function(e) {
        var data = e.clipboardData.items[0].getAsFile();
    
        var fr = new FileReader;
    
        fr.onloadend = function() {
            alert(fr.result.substring(0, 100)); // fr.result is all data
        };
    
        fr.readAsDataURL(data);
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: At my company we are developing a bunch applications that are using the
Background This is only my second PyQt4 project. Developing a Windows app that has
Background I work for a large organization which has thousands of MS Access applications
Background: I have a website that has been built with ASP.NET 2.0 and is
Background: I've wrote a small library that is able to create asp.net controls from
Background I've got an NSOutlineView that shows TrainingGroup entities. Each TrainingGroup represents a folder
Background I am developing a social web app for poets and writers, allowing them
Background: I know, via pypi, about DOAP . Is there something similar to describe
Background I have a basic HTML page with an iframe that points to a
Background My project is urgent and requires that I iterate a large XML file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.