{"course":{"slug":"prompting","title":"Getting Real Work out of a Model","url":"https://addaly.com/learn/prompting","level":"beginner","track":"start"},"lesson":{"slug":"what-happens-to-an-attachment","title":"What actually happens when you attach a file","url":"https://addaly.com/learn/prompting/what-happens-to-an-attachment","position":16,"of":72,"minutes":9,"answer":"Attaching a file sends a derivative of it (extracted text, OCR output, images, or retrieved fragments) so verify what actually arrived before trusting a summary of what is in it.","keyIdea":"Attaching a file sends a derivative of it (extracted text, OCR output, images, or retrieved fragments) so verify what actually arrived before trusting a summary of what is in it."},"body":{"format":"markdown","text":"## Attaching is not the same as pasting\n\nYou drag a PDF into the chat. It appears as a neat little card. It is easy to assume the model now has the document.\n\nWhat actually happened depends on the product, and there are four common paths.\n\n**Text extraction.** The product pulls the text layer out of the PDF and puts it in the prompt as plain text. Layout is lost. Two-column pages sometimes interleave. Footnotes land mid-sentence. Tables become runs of numbers whose column membership is a guess.\n\n**OCR.** If the PDF is a scan (a photographed invoice, an old policy document) there is no text layer, and the product runs optical character recognition to make one. Modern OCR is good and not perfect: handwriting, faint stamps, rotated pages and unusual scripts all produce errors, and the errors are silent. A `3` read as `8` looks exactly like a fact.\n\n**Vision.** Some products send the page to the model as an image. This preserves layout and handles handwriting far better, and it costs many more tokens per page, so products often use it selectively or cap the number of pages.\n\n**Retrieval.** For a long document, the product may split it into chunks, index them, and inject only the chunks that look relevant to your question. This is the one that surprises people: the model is answering from a handful of passages, not from the document. Ask \"does this contract mention arbitration anywhere?\" and a negative answer might mean the arbitration chunk did not get retrieved.\n\nYou usually cannot tell from the interface which of the four happened.\n\n> Figure: What happens to a file after you attach it. Steps: 1. You attach a PDF (it appears as a neat card); 2. Text layer, or OCR (extract the text, or recognise it from a scan; layout is lost, misreads are silent); 3. Long? chunk and index (split into passages and pick the ones that look relevant); 4. Inject (full text, selected chunks, or the pages as images); 5. The model answers (from what arrived, not from the file). Four paths, one identical card in the interface. Ask for the page count and the last line of the document to find out which one you got.\n\n## How to find out in ten seconds\n\nAsk.\n\n> Before answering: how many pages did you receive, what is the first line on page 1, and what is the last line of the document?\n\nAn answer that gets the last line right means the whole thing arrived. A vague answer, or a confident wrong one, tells you the model is working from fragments. This one habit prevents a specific and nasty failure: a summary that reads beautifully and omits the section that was never delivered.\n\nFor a spreadsheet, ask for the sheet names, the header row, and the row count. For a scan, ask it to quote three numbers and check them against the paper.\n\n## What to do about each failure\n\n**Layout mangled.** Copy the section you care about and paste it as text, cleaned up. Yes, by hand. For one clause it takes a minute.\n\n**Scan misread.** For a critical figure, check it yourself. Never let an OCR'd number go into an invoice, a dose, a tax return or a contract without a human comparing it to the original.\n\n**Only fragments retrieved.** Ask a question that forces a sweep (\"list every section heading in order\") before asking the substantive question. If the list is short or stops early, you know what you are dealing with.\n\n**Spreadsheet mishandled.** Numbers are where this hurts most. Prefer pasting a CSV extract, or ask the product to run code on the file if it can (many now do: it writes Python, executes it, and reports the result). Arithmetic done in code is arithmetic you can check; arithmetic done in prose is a guess with good manners.\n\n## Images are also attachments\n\nPhotographs of documents, screenshots, diagrams, charts. Vision models read these well enough to be useful and badly enough to be dangerous with small print. Three practical notes:\n\n- **Crop and enlarge.** A photo of a whole page where you care about one paragraph is mostly wasted. Crop it.\n- **Say what you want read.** \"Read the figures in the third column\" beats \"what does this say\".\n- **Charts are inference.** Reading a value off a chart with no data labels is estimating a pixel position. Treat the number as approximate, always.\n\n## The free path\n\nIf a product mangles a PDF, you can do the extraction yourself before pasting: `pdftotext` (part of the free Poppler tools) for text-layer PDFs, Tesseract for OCR, LibreOffice to convert an old `.doc`, and any spreadsheet application to export a clean CSV. All free, all offline. Ten seconds at a terminal often gives cleaner input than the upload button, and you can see exactly what you are handing over.\n\n## The rule underneath\n\nAn attachment is a promise that some text derived from your file reached the model. Which text, how much, and how accurately are separate questions, and on anything consequential you should ask them before you trust the answer."},"check":{"question":"A lawyer uploads a 90-page agreement and asks whether it contains an arbitration clause. The model says no. What is the safest interpretation?","options":[{"text":"The model read the whole document and found nothing, since files are always supplied in full.","correct":false,"tempting":"Assumes one delivery mechanism; long documents are frequently chunked and retrieved selectively."},{"text":"A negative answer is more trustworthy than a positive one, because inventing an absence is unlikely.","correct":false,"tempting":"Inverts the risk: an absence is exactly what incomplete delivery produces, while a quoted clause is at least checkable."},{"text":"The clause is probably present but expressed in unusual language the model did not recognise.","correct":false,"tempting":"Possible, but it skips the more common and more easily tested explanation about what reached the model."},{"text":"The answer may reflect only the passages retrieved for that question, so a sweep of section headings is needed before relying on the negative.","correct":true}]},"prev":{"slug":"memory-and-what-it-remembers","title":"Memory, and the notes it took about you","url":"https://addaly.com/learn/prompting/memory-and-what-it-remembers"},"next":{"slug":"what-to-leave-out","title":"Choosing what not to include","url":"https://addaly.com/learn/prompting/what-to-leave-out"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'What actually happens when you attach a file', in Getting Real Work out of a Model. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/prompting/what-happens-to-an-attachment (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"What actually happens when you attach a file","courseTitle":"Getting Real Work out of a Model","module":{"index":2,"slug":"the-material-you-give-it","title":"The material you give it"},"answer":null,"keyIdea":"Attaching a file sends a derivative of it (extracted text, OCR output, images, or retrieved fragments) so verify what actually arrived before trusting a summary of what is in it.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure","figure":{"type":"flow","steps":[{"label":"You attach a PDF","detail":"it appears as a neat card"},{"label":"Text layer, or OCR","detail":"extract the text, or recognise it from a scan; layout is lost, misreads are silent"},{"label":"Long? chunk and index","detail":"split into passages and pick the ones that look relevant"},{"label":"Inject","detail":"full text, selected chunks, or the pages as images"},{"label":"The model answers","detail":"from what arrived, not from the file"}],"title":"What happens to a file after you attach it","caption":"Four paths, one identical card in the interface. Ask for the page count and the last line of the document to find out which one you got."},"alt":"Figure: What happens to a file after you attach it. Steps: 1. You attach a PDF (it appears as a neat card); 2. Text layer, or OCR (extract the text, or recognise it from a scan; layout is lost, misreads are silent); 3. Long? chunk and index (split into passages and pick the ones that look relevant); 4. Inject (full text, selected chunks, or the pages as images); 5. The model answers (from what arrived, not from the file). Four paths, one identical card in the interface. Ask for the page count and the last line of the document to find out which one you got."}},"blocks":[{"t":"h2","id":"attaching-is-not-the-same-as-pasting","runs":[{"text":"Attaching is not the same as pasting"}]},{"t":"p","runs":[{"text":"You drag a PDF into the chat. It appears as a neat little card. It is easy to assume the model now has the document."}]},{"t":"p","runs":[{"text":"What actually happened depends on the product, and there are four common paths."}]},{"t":"p","runs":[{"text":"Text extraction.","b":true},{"text":" The product pulls the text layer out of the PDF and puts it in the prompt as plain text. Layout is lost. Two-column pages sometimes interleave. Footnotes land mid-sentence. Tables become runs of numbers whose column membership is a guess."}]},{"t":"p","runs":[{"text":"OCR.","b":true},{"text":" If the PDF is a scan (a photographed invoice, an old policy document) there is no text layer, and the product runs optical character recognition to make one. Modern OCR is good and not perfect: handwriting, faint stamps, rotated pages and unusual scripts all produce errors, and the errors are silent. A "},{"text":"3","code":true},{"text":" read as "},{"text":"8","code":true},{"text":" looks exactly like a fact."}]},{"t":"p","runs":[{"text":"Vision.","b":true},{"text":" Some products send the page to the model as an image. This preserves layout and handles handwriting far better, and it costs many more tokens per page, so products often use it selectively or cap the number of pages."}]},{"t":"p","runs":[{"text":"Retrieval.","b":true},{"text":" For a long document, the product may split it into chunks, index them, and inject only the chunks that look relevant to your question. This is the one that surprises people: the model is answering from a handful of passages, not from the document. Ask “does this contract mention arbitration anywhere?” and a negative answer might mean the arbitration chunk did not get retrieved."}]},{"t":"p","runs":[{"text":"You usually cannot tell from the interface which of the four happened."}]},{"t":"h2","id":"how-to-find-out-in-ten-seconds","runs":[{"text":"How to find out in ten seconds"}]},{"t":"p","runs":[{"text":"Ask."}]},{"t":"quote","runs":[{"text":"Before answering: how many pages did you receive, what is the first line on page 1, and what is the last line of the document?"}]},{"t":"p","runs":[{"text":"An answer that gets the last line right means the whole thing arrived. A vague answer, or a confident wrong one, tells you the model is working from fragments. This one habit prevents a specific and nasty failure: a summary that reads beautifully and omits the section that was never delivered."}]},{"t":"p","runs":[{"text":"For a spreadsheet, ask for the sheet names, the header row, and the row count. For a scan, ask it to quote three numbers and check them against the paper."}]},{"t":"h2","id":"what-to-do-about-each-failure","runs":[{"text":"What to do about each failure"}]},{"t":"p","runs":[{"text":"Layout mangled.","b":true},{"text":" Copy the section you care about and paste it as text, cleaned up. Yes, by hand. For one clause it takes a minute."}]},{"t":"p","runs":[{"text":"Scan misread.","b":true},{"text":" For a critical figure, check it yourself. Never let an OCR’d number go into an invoice, a dose, a tax return or a contract without a human comparing it to the original."}]},{"t":"p","runs":[{"text":"Only fragments retrieved.","b":true},{"text":" Ask a question that forces a sweep (“list every section heading in order”) before asking the substantive question. If the list is short or stops early, you know what you are dealing with."}]},{"t":"p","runs":[{"text":"Spreadsheet mishandled.","b":true},{"text":" Numbers are where this hurts most. Prefer pasting a CSV extract, or ask the product to run code on the file if it can (many now do: it writes Python, executes it, and reports the result). Arithmetic done in code is arithmetic you can check; arithmetic done in prose is a guess with good manners."}]},{"t":"h2","id":"images-are-also-attachments","runs":[{"text":"Images are also attachments"}]},{"t":"p","runs":[{"text":"Photographs of documents, screenshots, diagrams, charts. Vision models read these well enough to be useful and badly enough to be dangerous with small print. Three practical notes:"}]},{"t":"ul","items":[[{"text":"Crop and enlarge.","b":true},{"text":" A photo of a whole page where you care about one paragraph is mostly wasted. Crop it."}],[{"text":"Say what you want read.","b":true},{"text":" “Read the figures in the third column” beats “what does this say”."}],[{"text":"Charts are inference.","b":true},{"text":" Reading a value off a chart with no data labels is estimating a pixel position. Treat the number as approximate, always."}]]},{"t":"h2","id":"the-free-path","runs":[{"text":"The free path"}],"role":"free"},{"t":"p","runs":[{"text":"If a product mangles a PDF, you can do the extraction yourself before pasting: "},{"text":"pdftotext","code":true},{"text":" (part of the free Poppler tools) for text-layer PDFs, Tesseract for OCR, LibreOffice to convert an old "},{"text":".doc","code":true},{"text":", and any spreadsheet application to export a clean CSV. All free, all offline. Ten seconds at a terminal often gives cleaner input than the upload button, and you can see exactly what you are handing over."}]},{"t":"h2","id":"the-rule-underneath","runs":[{"text":"The rule underneath"}]},{"t":"p","runs":[{"text":"An attachment is a promise that some text derived from your file reached the model. Which text, how much, and how accurately are separate questions, and on anything consequential you should ask them before you trust the answer."}]}],"check":{"question":[{"text":"A lawyer uploads a 90-page agreement and asks whether it contains an arbitration clause. The model says no. What is the safest interpretation?"}],"options":[{"text":[{"text":"The model read the whole document and found nothing, since files are always supplied in full."}],"correct":false,"tempting":[{"text":"Assumes one delivery mechanism; long documents are frequently chunked and retrieved selectively."}]},{"text":[{"text":"A negative answer is more trustworthy than a positive one, because inventing an absence is unlikely."}],"correct":false,"tempting":[{"text":"Inverts the risk: an absence is exactly what incomplete delivery produces, while a quoted clause is at least checkable."}]},{"text":[{"text":"The clause is probably present but expressed in unusual language the model did not recognise."}],"correct":false,"tempting":[{"text":"Possible, but it skips the more common and more easily tested explanation about what reached the model."}]},{"text":[{"text":"The answer may reflect only the passages retrieved for that question, so a sweep of section headings is needed before relying on the negative."}],"correct":true,"tempting":null}],"order":[0,3,2,1],"why":null},"prev":{"slug":"memory-and-what-it-remembers","title":"Memory, and the notes it took about you","minutes":8},"next":{"slug":"what-to-leave-out","title":"Choosing what not to include","minutes":8}}}