Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Base64 conversion be handled within the code? #23

Closed
SKALIDHASAN opened this issue Apr 16, 2013 · 1 comment
Closed

Can Base64 conversion be handled within the code? #23

SKALIDHASAN opened this issue Apr 16, 2013 · 1 comment

Comments

@SKALIDHASAN
Copy link

Thanks for the Update on IE10, One more suggestion is to handle the Base64 conversion with in the code. Currently you have given an option to paste the Base64 string, can this be dynamically generated via the code accessing the variable "f" in the below code snippet?

function b64it(xlsxFile) {

    var xlsx = XLSX.readFile(xlsxFile, {type: 'file'});//<--How the base64 conversion should be handled
    process_xlsx(xlsx);
}

function handleDrop(e) {
    e.stopPropagation();
    e.preventDefault();
    var files = e.dataTransfer.files;
    var i,f;
    for (i = 0, f = files[i]; i != files.length; ++i) {
    b64it(f);//<-- f represents one of the files in the List

    /*
        var reader = new FileReader();
        var name = f.name;
        reader.onload = function(e) {
            var data = e.target.result;
            //var xlsx = XLSX.read(data, {type: 'binary'});
            var arr = String.fromCharCode.apply(null, new Uint8Array(data));
            var xlsx = XLSX.read(btoa(arr), {type: 'base64'});
            process_xlsx(xlsx);
        };
        //reader.readAsBinaryString(f);
        reader.readAsArrayBuffer(f);
    */  

    }//for

}//handleDrop
@redchair123
Copy link

I was originally working with IE6, which doesn't (as far as I can tell) support base64. The base64 mode was separated so that I could paste content into the textarea and test those features.

If you suggest a good way to add drag and drop support in IE6-9 (even if it required some flash or silverlight magic) I would get rid of the text box in a heartbeat.

To clarify: the base64 part is actually integrated in the zip container handling (the jszip.js file).

clarketm pushed a commit to clarketm/js-xlsx that referenced this issue Nov 27, 2016
added check for module as well as require for node environment
shenquan815 pushed a commit to shenquan815/SSSS that referenced this issue Mar 24, 2020
SheetJSDev added a commit that referenced this issue Mar 9, 2022
- do not consume trailing currency symbol (fixes #19 h/t @wilg)
- detect minutes following absolute hour (fixes #23 h/t @tedbeer)
- verify the miscellaneous formats (fixes #27 h/t @reviewher)
KingTiger001 added a commit to KingTiger001/sheet-project that referenced this issue Dec 18, 2022
@SheetJS SheetJS locked and limited conversation to collaborators Feb 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants