attachment
attachment

How to dial this number

analyse_media
The number shown is +91-11-45593000.
  • Calling from within India: dial 011 45593000
  • Calling from outside India: dial +91 11 45593000
It is the NBEMS contact centre, open Monday to Friday, 9:30 AM to 6:00 PM.

I am trying to upload this file to submit a form but on submissions it is showing that it has malicious content

Reading File
Browsing Directory

~/

Browsing Directory

~/attachments/5edeb78c-f33d-424c-8ac3-b66c50be9e3b

Reading File
Searching the Web

PDF upload rejected malicious content how to sanitize PDF remove JavaScript embedded files official guidance

Running Command

python -c "from pypdf import PdfReader; p='/tmp/workspace/attachments/5edeb78c-f33d-424c-8ac3-b66c50be9e3b/appproval.pdf'; r=PdfReader(p, strict=False); print('pages',len(r.pages)); print('encrypted',r.is_encrypted); print('metadata',r.metadata); print('root keys',list(r.trailer['/Root'].keys())); print('size',__import__('os').path.getsize(p)); [print('page',i+1,'keys',list(pg.keys())) for i,pg in enumerate(r.pages)]"

Running Command

python -c "import fitz; print(fitz.__doc__.split()[1])"

Running Command

mkdir -p "/tmp/workspace/pdf-cleanup/output" 66 python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/attachments/5edeb78c-f33d-424c-8ac3-b66c50be9e3b/appproval.pdf' r=PdfReader(p, strict=False) for i,page in enumerate(r.pages,1): a=page.get('/Annots') print('page',i,'annotations',len(a) if a else 0) if a: for x in a: o=x.get_object(); print(' ', o.get('/Subtype'), 'action',o.get('/A'), 'AA',o.get('/AA')) raw=open(p,'rb').read() for term in (b'/JavaScript',b'/JS',b'/EmbeddedFiles',b'/OpenAction',b'/Launch',b'/RichMedia',b'/XFA'): print(term.decode(),raw.count(term)) PY

Running Command

python - <<'PY' from pypdf import PdfReader, PdfWriter from pypdf.generic import NameObject src='/tmp/workspace/attachments/5edeb78c-f33d-424c-8ac3-b66c50be9e3b/appproval.pdf' out='/tmp/workspace/pdf-cleanup/output/appproval_clean.pdf' r=PdfReader(src, strict=False) w=PdfWriter() for page in r.pages: # annotations might trigger automated checks or refer to external objects; omit them if '/Annots' in page: del page[NameObject('/Annots')] w.add_page(page) # Do not copy document catalog extensions, Xodo marks, scripts, attachments, or original metadata w.add_metadata({'/Title':'Approval Document','/Producer':'PDF document clean copy'}) with open(out,'wb') as f: w.write(f) # Validate output rr=PdfReader(out, strict=False) print('created:',out) print('pages:',len(rr.pages),'encrypted:',rr.is_encrypted,'bytes:',__import__('os').path.getsize(out)) print('catalog:',list(rr.trailer['/Root'].keys())) print('metadata:',rr.metadata) print('page annotation flags:',[('/Annots' in pg) for pg in rr.pages]) raw=open(out,'rb').read() print('active-content markers:',{x.decode('ascii'):raw.count(x) for x in [b'/JavaScript',b'/JS',b'/EmbeddedFiles',b'/OpenAction',b'/Launch',b'/RichMedia',b'/XFA',b'/xodo_watermark']}) PY

I created a cleaned copy of your PDF that removes annotations, unusual document metadata, and active-content markers that can trigger upload filters. It still has all 5 pages.

appproval clean

PDF Document · PDF

Upload this version. If the portal still rejects it, the likely issue is its file-size or filename rule. Try renaming it to something simple like approval.pdf, then upload again.
attachment
attachment

Still showing this

analyse_media
Searching the Web

site:natboard.edu.in "Malicious content detected in file"

Running Command

python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/pdf-cleanup/output/appproval_clean.pdf'; r=PdfReader(p) for n,pg in enumerate(r.pages,1): rs=pg.get('/Resources',{}) xo=rs.get('/XObject',{}) print('PAGE',n,'xobjects',len(xo),'content bytes',len(pg.get_contents().get_data())) for name,ref in xo.items(): o=ref.get_object(); print(name,o.get('/Subtype'),o.get('/Width'),o.get('/Height'),o.get('/Filter'),len(o.get_data()) if o.get('/Subtype')=='/Image' else '') PY

Browsing Directory

~/pdf-cleanup

Running Command

python - <<'PY' from pypdf import PdfReader from PIL import Image from io import BytesIO from pathlib import Path src=Path('/tmp/workspace/attachments/5edeb78c-f33d-424c-8ac3-b66c50be9e3b/appproval.pdf') outdir=Path('/tmp/workspace/pdf-cleanup/output/raster_pages') outdir.mkdir(parents=True, exist_ok=True) r=PdfReader(str(src), strict=False) images=[] for n,pg in enumerate(r.pages,1): xobj=pg['/Resources']['/XObject'] # Main full-page scan is highest-pixel image candidates=[] for _,ref in xobj.items(): ob=ref.get_object() if ob.get('/Subtype') == '/Image': candidates.append((int(ob.get('/Width',0))*int(ob.get('/Height',0)), ob)) ob=max(candidates,key=lambda z:z[0])[1] im=Image.open(BytesIO(ob.get_data())).convert('RGB') # preserve practical legibility while reduce file size im.thumbnail((1650, 2350), Image.Resampling.LANCZOS) jpg=outdir/f'page-{n}.jpg' im.save(jpg,'JPEG',quality=88,optimize=True,progressive=False) images.append(Image.open(jpg).convert('RGB')) # Standard image-only PDF. No links/forms/scripts/annotations/metadata. out=Path('/tmp/workspace/pdf-cleanup/output/approval_upload.pdf') images[0].save(out, 'PDF', save_all=True, append_images=images[1:], resolution=200.0, title='', author='', subject='', keywords='') print(out, out.stat().st_size) # basic static inspection rr=PdfReader(str(out),strict=False) print('pages',len(rr.pages),'root',list(rr.trailer['/Root'].keys()),'metadata',rr.metadata) raw=out.read_bytes() print({m.decode('ascii'):raw.count(m) for m in [b'/JavaScript',b'/JS',b'/EmbeddedFiles',b'/OpenAction',b'/Launch',b'/RichMedia',b'/XFA',b'/Annots',b'/xodo_watermark']}) PY

Running Command

python - <<'PY' from reportlab.pdfgen import canvas from reportlab.lib.utils import ImageReader from reportlab.lib.pagesizes import A4 from pathlib import Path from PIL import Image outdir=Path('/tmp/workspace/pdf-cleanup/output') imgs=sorted((outdir/'raster_pages').glob('page-*.jpg'), key=lambda p:int(p.stem.split('-')[1])) out=outdir/'approval_rebuilt.pdf' c=canvas.Canvas(str(out), pagesize=A4, pageCompression=1, invariant=1) c.setTitle('Approval Document') c.setAuthor('') c.setSubject('') W,H=A4 for img_path in imgs: im=Image.open(img_path); iw,ih=im.size scale=min(W/iw,H/ih) dw,dh=iw*scale,ih*scale c.drawImage(ImageReader(str(img_path)),(W-dw)/2,(H-dh)/2,width=dw,height=dh,mask=None) c.showPage() c.save() print(out, out.stat().st_size) PY python - <<'PY' from pypdf import PdfReader p='/tmp/workspace/pdf-cleanup/output/approval_rebuilt.pdf' r=PdfReader(p, strict=False) print('pages',len(r.pages), 'root',list(r.trailer['/Root'].keys()), 'metadata',r.metadata) print('annots',[p.get('/Annots') for p in r.pages]) raw=open(p,'rb').read() print({key:raw.count(key.encode()) for key in ['/JavaScript','/OpenAction','/Launch','/EmbeddedFiles','/RichMedia','/XFA','/Annots','/xodo_watermark']}) PY

The previous cleaned copy was still based on the original PDF structure. I made a fully rebuilt, image-only PDF from the visible pages. It has no annotations, forms, scripts, attachments, links, or Xodo metadata.
Download and upload this exact file:

approval rebuilt

PDF Document · PDF

Before trying:
  1. Delete the previously selected file from the form.
  2. Download this new file to your phone.
  3. Rename it to approval.pdf if the portal permits.
  4. Select this newly downloaded file, not the older appproval_clean.pdf.
If this is also rejected, the portal's security filter is likely producing a false positive or it may require a different format or a smaller file. In that case, contact NBEMS at 011-45593000 during working hours and send them the screenshot of the exact error.

What to do now

Reading File
Browsing Directory

~/

Searching the Web

NBEMS exam portal contact technical support document upload malicious content detected file

Browsing Directory

~/attachments/5edeb78c-f33d-424c-8ac3-b66c50be9e3b

Running Command

python - <<'PY' from pypdf import PdfReader from pathlib import Path p=Path('/tmp/workspace/attachments/5edeb78c-f33d-424c-8ac3-b66c50be9e3b/Approval (1).pdf') r=PdfReader(str(p),strict=False) print('size',p.stat().st_size,'pages',len(r.pages),'encrypted',r.is_encrypted) print('root',list(r.trailer['/Root'].keys())) print('metadata',r.metadata) raw=p.read_bytes() print({x.decode('ascii'):raw.count(x) for x in [b'/JavaScript',b'/OpenAction',b'/Launch',b'/EmbeddedFiles',b'/RichMedia',b'/XFA',b'/Annots',b'/xodo_watermark']}) for n,page in enumerate(r.pages,1): print(n,'annots',bool(page.get('/Annots')),'MB',page.mediabox) PY

The file you just sent, Approval (1).pdf, has again been modified by Xodo. It contains Xodo watermark/annotation data, so do not upload this copy.
Use the original rebuilt file I made, without opening or saving it in Xodo:

approval rebuilt

PDF Document · PDF

Then do this on your phone:
  1. Download it from the link.
  2. Open the NBEMS portal in Chrome.
  3. When choosing the file, select it from Downloads/Files, not through Xodo.
  4. Do not preview, edit, share through Xodo, or choose “Save as” before uploading.
  5. Rename it only using the Files app if needed, to approval.pdf. Renaming is fine, but editing/re-saving is not.
  6. Upload it immediately.
Your current Approval (1).pdf was likely opened or re-saved by Xodo after download. That is what added the unwanted PDF elements back.
This is a shared conversation. Sign in to Orris to start your own chat.