Giter Club home page Giter Club logo

filetodatauri's People

Contributors

aymkdn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

filetodatauri's Issues

About file name

hello!
How can I get the file name after the file has been readed?
thanks!

Can we get the name of the file through swf?

Thank you very much for the simple solution. I am able to get the file stream (encoded data). But, I am failed to get the name of the file uploading. Is there any way we can get the file name as well? This is important that when uploading the file, on the server I should keep the same name as uploaded.

thanks

Get file attributes?

Hi, is there a way to get file attributes like file size, file name and file type?

getFileData method doesn't load at all,

var Flash = {
/* Flash.getFileData() is called after the file has been read /
getFileData: function(base64) {
showResult(base64)
},
/
getButtonLabel() permits to define another label for the "Load a file" button in the Flash version */
getButtonLabel: function() {
return "Load a file";
}
};

function showResult(b) {
$('#file-result').text(b)
}

unable to get binary data on showresult function

below reference added to code:
swfobject.embedSWF("../Content/FileToDataURI.swf", "file-object", "200px", "90px", "10", "../Content/expressInstall.swf", {}, {}, {});//}

and below 3 files are refereed;
Content/FileToDataURI.swf
../Content/expressInstall.swf
../Scripts/swfobject.js" refered as javascript link in page

FileToDataURI could not launch the getFileData from the JS .

Thanks you for this solution , I need to use it to support older browser , I tried the code from your example page , but the problem is that the button text is "Charger Fichier" ,and once I click on it no thing is happened ( the getFileData from the java script is not fired ).
your help will be appreciated.

Can I use FiletToDataURL.mxml to develop the commercial software?

Hi, I have one question and one request.
I'm using FiletToDataURL.mxml to develop the commercial software, which uploads users' files website. However, I found the statement, "CC BY-NC-SA 3.0" in FiletToDataURL.mxml

  • Question;
    Can I use FiletToDataURL.mxml to develop the commercial software?
  • Request
    In case that your answer is "Yes" for above question, would you modify "CC BY-NC-SA 3.0" in FiletToDataURL.mxml to "MIT License" and send me the update FiletToDataURL.mxml?

Thanks,
usitaka

Flash var not being loaded by swf file.

On my quest to upload base64 encoded image files in ie8&9 I came across your script. Looks promising but I'm having on issue.

I copy and pasted your example code, downloaded FileToDataURI.swf from the repo, downloaded expressInstall.swf and swfobject.js from the google link you provided, and updated the link to all three in the example code.

Everything works fine for browsers with FileReader but when it fallsback to flash there is an issue. The flash object is loaded and put on the page. But it seems like the Flash settings are not being used. The button is in german and after selecting a file nothing happens. Any ideas?

Here's my code

var Flash = {
    /* Flash.getFileData() is called after the file has been read */
    getFileData: function(base64) {
        console.log(base64);
        showResult(base64)
    },
    /* getButtonLabel() permits to define another label for the "Load a file" button in the Flash version */
    getButtonLabel: function() {
        return "Load a file";
    }
};

// we just want to show the result into the div
function showResult(b) {
    $('#file-result').text(b)
}

// check if the FileReader API exists... if not then load the Flash object
if (typeof FileReader !== "function")
    // we use 80px by 23px, because we want the object to have the same size than the button
    swfobject.embedSWF("/js/FileToDataURI.swf", "file-object", "120px", "50px", "10", "/js/expressInstall.swf", {}, {}, {});
else {
    // replace the <object> by an input file
    $('#file-object').replaceWith('<input type="file" id="file-object" value="Load a file" />');

    $('#file-object').on('change', function(e) {
        var files = e.target.files,file;

        if (!files || files.length == 0) return;
        file = files[0];

        var fileReader = new FileReader();

        fileReader.onload = function (e) {
            // ATTENTION: to have the same result than the Flash object we need to split
            // our result to keep only the Base64 part
            showResult(e.target.result.split(",")[1]);
            // showResult(e.target.result);

            $('#file-result').append('<img src="' + e.target.result + '" />');
        };

        fileReader.readAsDataURL(file);
    });
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.