Yahoo Search Búsqueda en la Web

Resultado de búsqueda

  1. 30 de sept. de 2010 · 13 Answers. Sorted by: 1649. Use the accept attribute of the input tag. To accept only PNG's, JPEG's and GIF's you can use the following code: <label>Your Image File. <input type="file" name="myImage" accept="image/png, image/gif, image/jpeg" /> </label> Or simply: <label>Your Image File. <input type="file" name="myImage" accept="image/*" />

    • Overview
    • Examples
    • Unique file type specifiers
    • Using file inputs
    • Browser compatibility
    • See also

    The accept attribute takes as its value a comma-separated list of one or more file types, or unique file type specifiers, describing which file types to allow.

    When set on a file input type, the native file picker that opens up should only enable selecting files of the correct file type. Most operating systems lighten the files that don't match the criteria and aren't selectable.

    Note the last example allows you to select multiple images. See the multiple attribute for more information.

    A unique file type specifier is a string that describes a type of file that may be selected by the user in an element of type file. Each unique file type specifier may take one of the following forms:

    •A valid case-insensitive filename extension, starting with a period (".") character. For example: .jpg, .pdf, or .doc.

    •A valid MIME type string, with no extensions.

    •The string audio/* meaning "any audio file".

    •The string video/* meaning "any video file".

    •The string image/* meaning "any image file".

    A basic example

    This produces the following output: Regardless of the user's device or operating system, the file input provides a button that opens up a file picker dialog that allows the user to choose a file. Including the multiple attribute, as shown above, specifies that multiple files can be chosen at once. The user can choose multiple files from the file picker in any way that their chosen platform allows (e.g. by holding down Shift or Control, and then clicking). If you only want the user to choose a single file per , omit the multiple attribute.

    Limiting accepted file types

    Often you won't want the user to be able to pick any arbitrary type of file; instead, you often want them to select files of a specific type or types. For example, if your file input lets users upload a profile picture, you probably want them to select web-compatible image formats, such as JPEG or PNG. Acceptable file types can be specified with the accept attribute, which takes a comma-separated list of allowed file extensions or MIME types. Some examples: •accept="image/png" or accept=".png" — Accepts PNG files. •accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" — Accept PNG or JPEG files. •accept="image/*" — Accept any file with an image/* MIME type. (Many mobile devices also let the user take a picture with the camera when this is used.) •accept=".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document" — accept anything that smells like an MS Word document.

    BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

    •Using files from web applications

    •File API

  2. accept="image/png, image/jpeg" o accept=".png, .jpg, .jpeg" — Acepta archivos PNG o JPEG. accept="image/*" — Acepta cualquier archivo con un tipo MIME de image/*. (Muchos dispositivos móviles también permiten que el usuario tome una foto con la cámara cuando se usa).

  3. Find Accepted stock images in HD and millions of other royalty-free stock photos, 3D objects, illustrations and vectors in the Shutterstock collection. Thousands of new, high-quality pictures added every day.

  4. Download and use 700+ Accepted stock photos for free. Thousands of new images every day Completely Free to Use High-quality videos and images from Pexels.

  5. 270 Free images of Accepted. Find illustrations of Accepted. Free for commercial use No attribution required High quality images.

  6. 424,161 accept stock photos, vectors, and illustrations are available royalty-free for download. Find Accept stock images in HD and millions of other royalty-free stock photos, illustrations and vectors in the Shutterstock collection. Thousands of new, high-quality pictures added every day.