HTML and CSS Reference
In-Depth Information
Figure 6-2. An example of an image file upload
With the multiple attribute, the user can select several files at once.
File Access in Advertising
Now that we've enabled users to upload an image, they can do the same with a text file, PDF, PSD—you name it—and
have the browser parse, manipulate, and render the information to the screen. With this information in mind, let's
allow users to drag-and-drop an image onto the ad's real estate from the desktop and have them use the HTML5
canvas element to paint on the image. From that, let's also allow the user to save that manipulated file locally.
Listing 6-3 gives an example.
Listing 6-3. File API Example with Canvas
<!DOCTYPE html>
<style type="text/css">
* {
margin: 0px;
padding: 0px;
position: relative;
canvas {
Search WWH ::

Custom Search