GithubHelp home page GithubHelp logo

travischoma / filetodatauri Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yannickcr/filetodatauri

0.0 2.0 0.0 135 KB

FileToDataURI is a jQuery plugin that allow you to retrieve the content (base64 encoded) of a local file using the HTML5 File API or using a Flash application if the File API is not available.

License: MIT License

filetodatauri's Introduction

FileToDataURI

FileToDataURI is a jQuery plugin that allow you to retrieve the content (base64 encoded) of a local file using the HTML5 File API or using a Flash application if the File API is not available.

It can be very useful under some not-so-modern browsers like IE7/8/9.

How to use

You can find the full documentation in the "docs" directory.

Example

HTML:

<button id="file-button">Select an image</button>
<div id="file-content"></div>

JavaScript:

$('#file-button').FileToDataURI({
	onSelect: function(files) {
		// Select the first file
		var file = files[0];

		// Write his content in the document
		$('#file-content').text(file);
	}
});

You can see a working example in the "example" directory.

Flash application compilation

Install the Flex SDK and run the following command :

$ ./bin/mxmlc FileToDataURI.as

And that's it !

TODO

  • Multiple file selection
  • Better mime-type generation

Licenses

FileToDataURI.as is licensed under the MIT License.

The Base64 library, by Jean-Philippe Auclair, is licensed under the MIT License.

filetodatauri's People

Contributors

aymkdn avatar yannickcr avatar

Watchers

 avatar  avatar

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.