Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesPut an accept attribute on the file input. For the usual JPG and PNG picker filter, use accept=".jpg,.jpeg,.png"; MIME-type syntax is accept="image/jpeg,image/png". This guides the browser’s file picker, but it does not prove that an uploaded file is really an image. Validate the content on your server before processing or storing it.
<input type="file" name="image" accept=".jpg,.jpeg,.png">
The smallest working example
Use a real label, a stable id, and a name that your server expects:
<label for="image">Choose a JPG or PNG image</label>
<input id="image" name="image" type="file" accept=".jpg,.jpeg,.png">
If the control submits a file to your application, place it in a form using multipart encoding:
<form method="post" action="/upload" enctype="multipart/form-data">
<label for="image">Choose a JPG or PNG image</label>
<input id="image" name="image" type="file" accept=".jpg,.jpeg,.png">
<button type="submit">Upload</button>
</form>
accept belongs on the input, not on the form. The enctype="multipart/form-data" setting is what allows the selected bytes to be transmitted in a normal form submission.
#1 Best Overall
- USB-C 2-in-1 storage OTG: The Lexar JumpDrive Dual Drive D40E features USB Type-A and Type-C connectors in a slim, portable form factor for easy device compatibility
- Transfer speeds up to 100MB/s: Based on internal testing, performance may vary depending upon the host device, interface, and usage conditions. 1MB=1,000,000 bytes
- Plug and Play: Widely compatible with USB Type-C smartphones, tablets, laptops, Macs, and traditional Type-A devices, no software installation required. The 360° swivel design allows for easy switching between connectors without the hassle of losing a cap
- Durable & Compact: The Lexar D40E USB memory stick features a metal enclosure, withstands temperatures from 0° to 50° C (32°F to 122°F), and is lightweight at 26g with dimensions of 70.4 x 16.9 x 11.7mm
- Security & Warranty: Securely protects files using an advanced security software solution with 256-bit AES encryption. Backed by a Lexar 3-year limited warranty
Choose extension or MIME-type syntax
The HTML Standard permits comma-separated filename extensions and valid MIME types as accepted tokens. Both forms are picker hints, not validation rules.
| Syntax | Example | What it expresses | When to use it |
|---|---|---|---|
| Filename extensions | .jpg,.jpeg,.png |
Names ending in the common JPEG or PNG suffixes | A clear, practical filter for ordinary file pickers |
| MIME types | image/jpeg,image/png |
Declared JPEG and PNG media types | When your code or documentation is organized around media types |
| Wildcard image type | image/* |
Any image format the user agent recognizes | Only when formats such as GIF, WebP or SVG are also acceptable |
For a JPG/PNG-only requirement, the extension form is easy for users to understand. The MIME form is equally valid. If you use MIME syntax, write JPEG as image/jpeg; image/jpg is not the standard MIME type.
Listing both .jpg and .jpeg matters because JPEG files commonly use either suffix. Tokens are comma-separated and should not be duplicated; matching is not meant to distinguish uppercase from lowercase spelling.
Allow one file or several
Without multiple, the picker selects one file. Add the Boolean attribute only when your endpoint is designed to receive a collection:
Rank #2
- High-speed USB 3.0 performance of up to 150MB/s(1) [(1) Write to drive up to 15x faster than standard USB 2.0 drives (4MB/s); varies by drive capacity. Up to 150MB/s read speed. USB 3.0 port required. Based on internal testing; performance may be lower depending on host device, usage conditions, and other factors; 1MB=1,000,000 bytes]
- Transfer a full-length movie in less than 30 seconds(2) [(2) Based on 1.2GB MPEG-4 video transfer with USB 3.0 host device. Results may vary based on host device, file attributes and other factors]
- Transfer to drive up to 15 times faster than standard USB 2.0 drives(1)
- Sleek, durable metal casing
- Easy-to-use password protection for your private files(3) [(3)Password protection uses 128-bit AES encryption and is supported by Windows 7, Windows 8, Windows 10, and Mac OS X v10.9 plus; Software download required for Mac, visit the SanDisk SecureAccess support page]
<label for="images">Choose JPG or PNG images</label>
<input id="images" name="images" type="file" accept=".jpg,.jpeg,.png" multiple>
Your server must then iterate over every submitted part, apply the same checks to each file, and define what happens when one item fails. Do not silently accept the valid files while pretending the rejected ones succeeded; return a result that identifies each outcome.
What accept does—and does not—do
The attribute tells the user agent which kinds of files the application prefers. Operating systems and browsers may present a filtered dialog, a format chooser, or an option to override the filter. Drag-and-drop, paste actions, mobile share sheets, and programmatic requests can also supply bytes without following the visual filter.
- It improves the selection experience.
- It does not inspect the file’s bytes.
- It does not prevent a user from choosing a different format when the picker permits an override.
- It does not protect an upload endpoint from a forged request.
Consequently, a file whose name ends in .png can contain something else, and a request can declare any Content-Type it wants. Treat the browser hint as convenience only.
Validate the upload on the server
Perform validation before image processing, public storage, or handing the file to another service. A layered policy is stronger than any single check.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
- What You Get - 2 pack 64GB genuine USB 2.0 flash drives, 12-month warranty and lifetime friendly customer service
- Great for All Ages and Purposes – the thumb drives are suitable for storing digital data for school, business or daily usage. Apply to data storage of music, photos, movies and other files
- Easy to Use - Plug and play USB memory stick, no need to install any software. Support Windows 7 / 8 / 10 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, compatible with USB 2.0 and 1.1 ports
- Convenient Design - 360°metal swivel cap with matt surface and ring designed zip drive can protect USB connector, avoid to leave your fingerprint and easily attach to your key chain to avoid from losing and for easy carrying
- Brand Yourself - Brand the flash drive with your company's name and provide company's overview, policies, etc. to the newly joined employees or your customers
- Define an allowlist. Permit only the formats your product actually needs: JPEG and PNG in this case. Decide a maximum byte size and, if relevant, maximum pixel dimensions.
- Normalize and check the name. Extract the final extension safely, handle case differences, and generate your own storage name. Never use a user-supplied path as a destination.
- Do not trust the submitted media type. A multipart part’s
Content-Typeis supplied by the client and can be forged. It is useful as a signal, not as proof. - Inspect the file signature and structure. Check magic bytes and use an image library that can decode the claimed format. Signature checks alone are not sufficient: malformed or polyglot content can still pass a superficial test.
- Parse or rewrite the image. Decoding and re-encoding to a supported format can discard unexpected trailing data. Keep this step in a sandboxed process with resource limits.
- Enforce resource limits. Apply byte, pixel, processing-time, and memory limits to reduce denial-of-service risk from deliberately expensive images.
- Store safely. Keep uploads outside executable web roots when possible, serve them with a safe content-disposition policy, and use access controls appropriate to whether images are private or public.
This validation belongs on the server even when the same checks are repeated in JavaScript for faster feedback. Client-side checks can improve the interface; they cannot establish trust.
Accessible and predictable markup
Associate a visible <label> with the input’s id. Keep the name stable so server code and automated tests can find the field. If an image is required for the form to be useful, add the HTML required attribute, but still handle a missing part on the server because clients can omit it.
<form method="post" action="/profile/photo" enctype="multipart/form-data">
<label for="avatar">Profile photo (JPG or PNG)</label>
<input
id="avatar"
name="avatar"
type="file"
accept="image/jpeg,image/png"
required>
<button type="submit">Save photo</button>
</form>
Do not replace the input with a custom button that has no keyboard or screen-reader equivalent. If you add a preview, treat it as untrusted local data and do not send it to the server as evidence that validation has passed.
Common problems and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| Other formats still appear in the dialog | The operating system or browser allows the filter to be overridden, or the control uses image/*. |
Use .jpg,.jpeg,.png or image/jpeg,image/png, and enforce the allowlist on the server. |
| A JPEG is rejected when the input says JPG | Only .jpg was listed. |
Include both .jpg and .jpeg. |
| The server receives no file | The form lacks enctype="multipart/form-data", the input has no name, or the request is too large. |
Check all three settings and inspect the server’s request-size limits. |
| A renamed non-image gets through | The application trusts the extension or client-declared MIME type. | Reject it with layered server checks: allowlisted extension, signature, decoder, and resource limits. |
| Multiple selections arrive as one item | The input lacks multiple, or the server reads only the first multipart part. |
Add multiple deliberately and iterate over every part. |
| PNG uploads fail after a seemingly valid signature | The file is truncated, malformed, or exceeds decoder limits. | Decode it with a maintained image library, return a specific error, and enforce bounded dimensions and processing time. |
A practical test checklist
- Select a small valid
.jpg,.jpeg, and.png. - Try uppercase suffixes and confirm your server’s policy is intentional.
- Attempt a GIF, WebP, text file, and an executable renamed with an image suffix.
- Try a file larger than the configured limit and an image with extreme dimensions.
- Submit with no file, then submit by drag-and-drop if your interface supports it.
- Send a direct multipart request that forges the filename and
Content-Type; it should still be rejected when the bytes are not an allowed image. - For
multiple, test a mixture of valid and invalid files and verify the response identifies each result.
Or skip the browser setup
If you are documenting or reviewing an upload page, ScreenshotNeo can capture the rendered page through one HTTP request. It is a screenshot service, not a replacement for server-side upload validation: use it to record the interface, picker instructions, and validation messages after your application has implemented them.
Recommended Free Tools
Rank #4
- GOOD VALUE PACKAGE - 1 Pack 32GB Memory Stick USB 2.0 Flash Drives with great cost performance and high quality.
- BIG CAPACITY - The available capacity: 29.10GB-29.8GB, You can save the data of movies, music, photos, designs, programs, manuals, handouts in a high speed.Good performance in digital data storing, transferring and sharing with families, friends, workmates, clients and machines.
- EASY TO USE & PLUG AND WORK - Support windows 7 / 8 / 10 / Vista / XP / 2000 / ME / NT Linux and Mac OS, Compatible with USB2.0 and below.
- TWISTTURN DESIGN & EASY CARRY - The metal clip rotates 360° round the ABS plastic body which with rubber oil skin feeling finish. The capless design can avoid lossing of cap, and providing efficient protection to the USB port.
- WARRANTY & SUPPORT - SIMMAX logo is laser printed on the USB connector surface, our products are of good quality and we promise that any problem about the product within one year since you buy.
For example, capture a publicly reachable upload page as WebP:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/upload -o shot.webp
See the ScreenshotNeo API documentation for request options. Equivalent Python and Node.js calls are:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com/upload"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com/upload' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Before capture, ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Only clean shots are billed. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response reports the result in X-Page-Verdict and X-Billed headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
FAQ
Does accept change how the file is encoded in a form?
No. It changes the chooser hint. The form still needs multipart/form-data to transmit file bytes.
Can a user bypass the filter without changing your HTML?
Yes. Picker overrides, drag-and-drop, paste, and direct HTTP requests may supply another format. The server must make the final decision.
Best Value
- 【16GB Flash Drive】USB flash drives with 16GB capacity, meet your needs of daily use on work, school, home and travelling for photos, music, videos, files storage and transfer. IMEASON thumb drives can be used to store different files, easy to data backup.
- 【Metal Swivel Cap Design】USB thumb drive is metal swivel cover provides extra protection for the usb thumbdrive connector, no usb drive cap to lose; keychain design makes it easier to carry without worrying lose it.
- 【Wide Compatibility】USB drive supports Windows 7/8/10/11 / Vista / XP / Unix / 2000 / ME / NT Linux and Mac OS, also Supports USB 2.0 and 1.1 ports. USB Stick support TV, desktop, notebook computer, car, audio and other device. The USB Memory Stick is your great data storage and transfer companion with traveling and working.
- 【Easy to use】usb memory stick is plug and play without any software installation. Just simply plug the Flashdrive into the port of your USB-compatible devices such as computer, laptop to start data storage or transmission.
- 【What You Get】16 GB USB Flash Drive Thumb Drive, The default format of the usb storage flash drive is FAT32.
Should every image application accept image/*?
No. Use the narrowest allowlist that matches the product. image/* includes formats beyond JPG and PNG and can create processing or compatibility work you did not intend.
Frequently Asked Questions
Does accept change how the file is encoded in a form?
No. It changes the chooser hint. The form still needs multipart/form-data to transmit file bytes.
Can a user bypass the filter without changing your HTML?
Yes. Picker overrides, drag-and-drop, paste, and direct HTTP requests may supply another format. The server must make the final decision.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchShould every image application accept image/*?
No. Use the narrowest allowlist that matches the product. image/* includes formats beyond JPG and PNG.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




