Imagine checking your passport photograph three times: it is a genuine JPEG, its dimensions are an exact 200 × 230 pixels, and its file size is a safe 34,200 bytes—well inside the 20 KB to 50 KB requirement. Yet the moment you select it on the recruitment portal, a red error banner flashes: "Invalid File Format! Only JPG/JPEG allowed" or "Special characters not allowed in file name." You open the image on your laptop and confirm it is definitely a .jpg. Why is the portal lying about the format?
The answer lies in how legacy backend scripts and Web Application Firewalls (WAFs) on government servers inspect incoming uploads. Before inspecting the binary image data, a portal’s validation code first examines the filename string sent in the HTTP request header. To block hackers from uploading executable scripts disguised with double extensions—such as shell.php.jpg or exploit.asp.pdf—many government portals reject *any* filename that contains more than one dot, or they naively read whatever comes immediately after the *first* dot as the file extension.
When you upload a file named rahul.kr.sharma.jpg, a naive script splits the string at the first dot, concludes that the file extension is .kr, and throws an "Invalid File Format" error. Similarly, Windows duplicate suffixes like photo (1).jpg or WhatsApp’s default export names contain spaces, parentheses, and multiple dots that trip strict security filters. This guide breaks down the exact filename rules used by recruitment portals and shows how a five-second rename prevents false format rejections.
Quick answer & key takeaways
Many government recruitment portals validate file formats by splitting the filename at the first period (.) rather than the last one, or by running a strict regular-expression firewall filter against the filename string. As a result, a valid JPEG named my.photo (final).jpg or WhatsApp Image 2026-10-19 at 4.15.02 PM.jpeg gets rejected as an "Invalid File Format" or "Malicious File" before the server ever checks the image itself.
- Naive portal scripts that split filenames at the first period (
.) readrahul.sharma.jpgas having a.sharmaextension and reject it as an invalid file format. - Web Application Firewalls (WAFs) on NIC, PSU, and banking portals actively block filenames containing double dots (
..), parentheses(1), ampersands (&), apostrophes ('), and quotes to prevent path-traversal and SQL/command injection attacks. - Default filenames generated by WhatsApp (
WhatsApp Image 2026-10-19 at 14.22.10.jpeg) and Windows duplicate downloads (signature (2).jpg) are the number-one source of false format rejections. - Some older state portals are even case-sensitive on extensions, accepting lowercase
.jpgand.pdfwhile rejecting uppercase.JPGor four-letter.jpegstrings. - Using a strict lowercase alphanumeric naming habit—like
photo.jpg,sign.jpg, andcaste.pdf—eliminates 100% of filename-based security rejections across every exam board.
The "First Dot" bug and double-extension security blocks
In web security, one of the oldest server attacks is the "double extension" exploit, where an attacker uploads a file named invoice.php.jpg hoping that an improperly configured Apache or IIS server will execute the .php code. Because recruitment portals handle millions of public file uploads from unauthenticated users, government cybersecurity auditors require strict countermeasures against double extensions.
Instead of parsing only the final extension safely and renaming the file on the server, many portal scripts implement one of two blunt rules: either they reject any filename where the count of period characters (.) is greater than one, or they run filename.split(".")[1] to grab the extension. Under both methods, completely innocent candidate filenames fail immediately.
| Your actual filename on disk | What a naive portal parser sees | Error message shown to you | Safe renamed version |
|---|---|---|---|
r.k.verma.photo.jpg | Extension parsed after first dot as .k (or blocked for 4 dots) | Invalid file type. Only JPG/JPEG allowed. | photo.jpg |
WhatsApp Image 2026-08-14 at 10.30.45 AM.jpeg | Contains 3 dots (.30.45.jpeg), 6 spaces, and a 4-letter .jpeg extension | Invalid file format / File name is too long | photo.jpg |
signature (1).jpg | Parentheses ( and ) flagged by WAF regex filter ^[a-zA-Z0-9_-]+\.(jpg|jpeg)$ | Special characters not allowed in file name | sign.jpg |
10th_marksheet_&_passing_cert.pdf | Ampersand & breaks unescaped XML/HTML parameter parsing on the server | Upload failed / Server Error 500 | class10.pdf |
IMG_4092.JPG | Uppercase .JPG fails case-sensitive string comparison ext === "jpg" | Please select a valid .jpg file | photo.jpg |
How WhatsApp, Windows, and mobile scanners create illegal filenames automatically
Very few candidates intentionally type special characters into their filenames. Instead, the operating system or scanning app inserts them behind the scenes. The most notorious offender in India is WhatsApp: when you photograph your signature on your phone, send it to yourself on WhatsApp Web to get it onto your laptop, and click Download, WhatsApp saves the file as WhatsApp Image 2026-10-19 at 18.42.11.jpeg. That single default filename violates three portal rules at once: it has multiple periods in the timestamp (18.42.11), multiple spaces, and a .jpeg extension that 3-character validators reject.
The second major trap happens inside your browser’s Downloads folder. Suppose you compress your photo once, saving photo.jpg. Five minutes later you tweak the crop and download it again into the same folder. Windows, macOS, and Android automatically rename the second download to photo (1).jpg or photo(1).jpg so it does not overwrite the first file. Those parentheses (1) are outside the alphanumeric whitelist of strict portals.
- Mobile scanner app timestamps: Apps like Adobe Scan, CamScanner, and Microsoft Lens often default to names like
Scan 19 Oct 2026 (2).pdforDoc_19.10.2026.pdf, introducing spaces, brackets, and date dots. - Candidate name initials: Candidates who dutifully name their files after their official initials—such as
S.Subramanian_OBC.pdf—inadvertently introduce a period right after the first letter. - Long descriptive paths: Some state treasury and recruitment databases store the uploaded filename in a
VARCHAR(30)database column. A 48-character filename gets truncated mid-extension in the database, corrupting the link to your photo on your admit card.
The `.jpg` vs `.jpeg` vs `.JPG` extension mismatch
Technically, .jpg, .jpeg, .JPG, and .JPEG all refer to the exact same ISO/IEC 10918-1 Joint Photographic Experts Group image format. Inside the file, the binary bytes are identical. However, in poorly written client-side JavaScript validators, checking the extension is often done with a literal string comparison rather than a case-insensitive list.
For example, DSLR cameras and many iPhones save images with an uppercase .JPG extension, while WhatsApp and certain Android galleries save with a four-letter .jpeg extension. If a portal’s file input is coded with a strict check like fileName.endsWith(".jpg"), both .JPG and .jpeg fail instantly. Standardising every image upload to lowercase three-letter .jpg and every document upload to lowercase .pdf is the safest universal rule.
A universal 8-character naming standard that passes every portal in India
You never need to guess which characters a specific recruitment board’s firewall permits if you adopt a strict "8-character lowercase alphanumeric" rule for the files you actually upload. Even if you use detailed names like photo_200x230_45KB.jpg inside your master archive folder to stay organised, make it a habit to rename the final copy inside your per-exam submission folder to a single lowercase word.
| Document slot | Recommended upload filename | Characters used | Why it passes every validator |
|---|---|---|---|
| Candidate Photograph | photo.jpg | 5 letters + .jpg | Zero spaces, zero underscores, single dot, lowercase 3-letter ext |
| Candidate Signature | sign.jpg | 4 letters + .jpg | Short enough for legacy 12-char DB columns, pure ASCII |
| Left Thumb Impression | thumb.jpg | 5 letters + .jpg | Unambiguous, passes strictest [a-z]+\.jpg regex |
| Handwritten Declaration | decl.jpg | 4 letters + .jpg | Avoids spaces or hyphens in "handwritten_declaration" |
| Class 10 / DOB Certificate | class10.pdf | 7 alphanumeric + .pdf | Avoids 10th superscripts or slashes like 10th/matric |
| Category / OBC / EWS / SC / ST | caste.pdf | 5 letters + .pdf | Avoids hyphens in obc-ncl or slashes in sc/st |
Before uploading, drop your final renamed files into the Application file checker. The checker inspects both the filename structure and the internal binary magic bytes (FF D8 FF for JPEG, %PDF- for PDF), giving you complete confidence that neither the filename filter nor the binary parser will reject your submission.
How to sanitise a rejected file so it passes portal filename and format checks
- Enable visible file extensions on your computer
In Windows File Explorer, go to View -> Show -> File name extensions so you can see the true extension of every file. This prevents accidentally naming a file photo.jpg.jpg or overlooking a .jpeg or .png suffix.
- Inspect the true binary format in Application File Checker
Open Application file checker and drop the rejected file in. Confirm whether the internal magic bytes are genuinely JPEG or PDF. If the file is actually a PNG, WebP, or HEIC disguised with a .jpg extension, renaming alone will not fix it.
- Re-encode if dimensions, bytes, or format need correction
If the checker reports a non-JPEG format, wrong pixel dimensions, or a byte count over the decimal KB cap, load the original into the Photo & Signature tool (Photo & signature) or PDF Compressor (PDF compressor) and export a fresh copy.
- Rename using only lowercase letters and a single period
Save or rename the final file in a local folder using a single lowercase word such as photo.jpg, sign.jpg, thumb.jpg, or caste.pdf. Strip out all spaces, initials with dots, brackets like (1), hyphens, and ampersands.
- Upload the freshly renamed file directly from your local folder
Return to the recruitment portal, click Choose File / Browse, select your clean photo.jpg or sign.jpg file, and click Upload. The file will pass both the first-dot extension parser and the Web Application Firewall regex.
Common mistakes to avoid
What goes wrong: Uploading a file directly after downloading it from WhatsApp Web without changing its default timestamped filename.
Better approach: Always rename WhatsApp downloads from WhatsApp Image 2026...jpeg to photo.jpg and re-encode them in Photo & signature to ensure compliant dimensions and baseline JPEG headers.
What goes wrong: Re-downloading a compressed file into the same Downloads folder so Windows adds (1) or (2) to the name.
Better approach: Delete old drafts or save the final file into a dedicated exam folder as photo.jpg with no bracketed numbers.
What goes wrong: Typing .jpg during a rename when Windows has file extensions hidden, resulting in photo.jpg.jpg.
Better approach: Turn on "File name extensions" in Windows File Explorer View settings so you always see the full filename including its single extension.
What goes wrong: Using initials with periods in document names, such as A.P.Sharma_EWS.pdf.
Better approach: Keep candidate names out of the filename if they contain dots or spaces, or write them without punctuation like apsharma.pdf or simply ews.pdf.
Frequently asked questions
Why does the portal say "Invalid File Format" when the real problem is a space or bracket in the filename?
Many recruitment portals combine their filename character check and their extension check into a single validation function—for example, matching the filename against the regular expression ^[a-zA-Z0-9]+\.(jpg|jpeg)$. When a filename like photo (1).jpg fails that pattern because of the space and brackets, the script triggers its single default error message: "Invalid file format."
Are underscores (`_`) and hyphens (`-`) safe in exam portal filenames?
Most modern portals accept underscores and hyphens, such as passport_photo.jpg. However, a small number of strict state university and municipal recruitment portals use an alphanumeric-only regex (^[a-zA-Z0-9]+\.jpg$) that even rejects underscores. Using a single word like photo.jpg or class10.pdf is 100% immune to that restriction.
Does changing the filename extension from `.jpeg` to `.jpg` corrupt the image?
If the file is already a genuine JPEG image, changing its four-letter .jpeg extension to the three-letter .jpg extension does not alter or corrupt the image data at all—both extensions represent the exact same file format. However, changing .png, .webp, or .heic to .jpg without re-encoding *will* fail binary inspection.
What if the official notification specifically asks me to name the file with my Roll Number or Registration ID?
Always follow the notification’s explicit naming instruction if one is given—for example, 10293847_photo.jpg or 10293847.pdf. Just make sure you do not add any extra spaces, brackets, or duplicate dots around the required format.
Can a long folder name on my laptop cause a filename error on the portal?
No. Because modern browsers mask your folder path as C:\fakepath\ and only transmit the filename itself (photo.jpg) in the HTTP upload header, the names of the folders on your computer do not affect the portal—only the name of the file itself matters.
Summary
A valid photograph or PDF should never be rejected just because Windows added (1) to the end of its name or because you put dots between your initials. Yet legacy extension parsers and strict firewall rules on government portals reject multi-dot and special-character filenames every day. Make it a habit to verify your files in the local Application File Checker and rename every final upload to a short, single-dot lowercase word like photo.jpg, sign.jpg, or caste.pdf. That simple step removes an entire category of mysterious portal errors.