Tutorials / Prompt Engineering with ChatGPT / Working with files and images

Working with files and images

13 min read text
Course contents (19 lessons)
  1. Understanding the tool
  2. What a language model is, in plain words
  3. How ChatGPT works from a user's point of view
  4. Building a good prompt
  5. The anatomy of a good prompt
  6. Being specific: how to remove guesswork
  7. Showing examples: few-shot prompting
  8. Asking for step-by-step reasoning
  9. Controlling and improving answers
  10. Controlling length, tone and format
  11. Iterating: how to improve an answer with follow-ups
  12. Custom instructions and memory
  13. Working with files and images
  14. ChatGPT for real tasks
  15. Using ChatGPT for writing: emails, reports and rewrites
  16. Using ChatGPT for studying and learning
  17. Using ChatGPT for coding and technical work
  18. Using ChatGPT for data, spreadsheets and business tasks
  19. Prompt templates
  20. A library of reusable prompt templates
  21. Reliable and safe use
  22. Avoiding hallucinations and checking facts
  23. Privacy and safe use
  24. Workflows and final project
  25. Building repeatable workflows and custom assistants
  26. Final project: build your own prompt toolkit

What this feature is for

Many versions of ChatGPT let you attach files and images to a message. Which file types work, how large they can be, and how many you can upload depend on your version and plan, and these limits change. Check what your screen allows. The ideas below stay the same.

The main benefit: you are no longer asking from memory. You are asking about a specific document you gave it. This is the best way to reduce invented answers, because the model can point at text in your file.

Documents: ask about what is in them

After uploading a report, contract or article, start with a clear instruction about how to use it.

I have attached a supplier contract. Read it and answer using only
what the document says.

1. Summarise the contract in 6 bullet points.
2. List every date, deadline and notice period, with the clause number.
3. List anything unusual or one-sided that I should ask a lawyer about.

If something is not in the document, write "not stated". Do not guess.
This is for my own understanding and is not legal advice.

This prompt works well for three reasons. "Using only what the document says" ties the answer to the source. The clause number requirement makes every claim checkable: you can open the contract and look. The "not stated" fallback stops invention. The last line is honest about the limit; a model's reading of a contract is a starting point for a conversation with a professional, not a replacement for one.

Long documents

Very long files may not be read completely, or details in the middle may be handled less well. A few ways to cope:

  • Ask about one section at a time: "Look only at the section called Payment Terms".
  • Ask it to quote the exact sentence it relied on, so you can see whether it read the right place.
  • For important documents, ask the same question a second way and compare.
For each of your answers above, quote the exact sentence from the
document that supports it. If you cannot find a quote, say so.

Spreadsheets and data files

If your version can run code, it can calculate with your data and even draw charts. If it cannot, it is reading the table as text, which is much less reliable for arithmetic. Ask what it can do first.

I have attached a spreadsheet of monthly sales (columns: Month, Region,
Product, Units, Revenue).

First, describe the columns and tell me if anything looks wrong (blank
cells, odd values, duplicated rows). Do not change anything yet.
Then show me the total revenue by region, as a table, and tell me
whether you calculated it by running code or by reading the numbers.

The last sentence is a quality check. A calculation done by running code is far more trustworthy than one done by eye. Asking it to look for problems before analysis is also the right order: bad data gives confident wrong answers.

Images

With image support, you can ask about a photo, a screenshot, a chart or a handwritten note. It reads the image and describes or extracts from it.

This is a photo of a printed price list taken on my phone.
Type out the items and prices as a table with the columns Item and
Price. Mark any text you could not read clearly with [unclear] and do
not guess at those parts.

The instruction "do not guess" matters even more with images. Blurry or angled photos lead to small reading errors, such as a 3 read as an 8, and these look fine in a neat table. Check any number that matters against the picture.

Other good uses:

Here is a screenshot of an error message from my software.
Explain what it most likely means in plain English, list the three most
likely causes, and tell me what to check first.
This is a chart from our monthly report. Describe what it shows in
two sentences, then list two things a manager might wrongly conclude
from it.

Handwriting, scans and other languages

Clear typed text works best. Handwriting, low-quality scans and unusual layouts, such as a table with merged cells, can lose details. Take photos in good light, straight on, and crop out the background. If the file is a scanned PDF, the text may be stored as a picture, which can be harder to process than a PDF with real text. For other languages, ask it to read the text and give a translation, and ask it to flag words it is unsure about.

Privacy before you upload

A file is not a throwaway message. It often contains names, addresses, account numbers and business secrets that you did not think about. Before you upload, ask: do I have the right to share this? Remove or blur anything that is not needed. For work documents, check your employer's rules first. We cover this in the privacy lesson.

The common mistake

Uploading a file and asking a broad question like "What do you think?" You get a general summary. Ask something the document can answer, such as "list the deadlines". The second mistake is assuming it read everything. If the answer looks too general, ask where in the document each point comes from.

Try it yourself

  1. Upload a non-private article or manual and use the "answer only from the document, quote your source" pattern with three questions.
  2. Take a clear photo of a printed page and ask for a transcription with an [unclear] marker. Compare it with the original.
  3. If your version supports data analysis, upload a small made-up spreadsheet and ask for totals. Check one result by hand.
text
I have attached a supplier contract. Read it and answer using only
what the document says.

1. Summarise the contract in 6 bullet points.
2. List every date, deadline and notice period, with the clause number.
3. List anything unusual or one-sided that I should ask a lawyer about.

If something is not in the document, write "not stated". Do not guess.
This is for my own understanding and is not legal advice.

This course is free to read. Create a free account to enrol, save your progress and pick up where you left off.

Sign up free I already have an account