Export and import behavior with Attachment, and other objects that have binary-blob fields, varies depending on what tool and API you are using.
If you execute a query via the REST API, the response will include for the Body
field the URL where you can access the body, but doesn't include the body itself:
GET /services/data/v44.0/query/?q=SELECT+Id,+Body+FROM+Attachment
{ "totalSize" : 1, "done" : true, "records" :
[
{
"attributes" : { "type" : "Attachment", "url" : "/services/data/v44.0/sobjects/Attachment/00P1R00000gXXXXUAS" },
"Id" : "00P1R00000gXXXXUAS",
"Body" : "/services/data/v44.0/sobjects/Attachment/00P1R00000gXXXXUAS/Body"
}
]
}
When using the SOAP API,
You can access all of the fields using a query() call. However, you can't receive the Body field for multiple records in a single query() call. If your query returns the Body field, your client application must ensure that only one row with one Attachment is returned; otherwise, an error occurs. A more effective approach is to return IDs (but not Attachment records in the Body field) from a query() call and then pass them into retrieve() calls that return the Body field.
The Bulk API does not support extracting binary-blob fields. It has special requirements for constructing a job that inserts binary content.
The Scheduled Data Export feature optionally may export Attachment and Content files. When it does so, you'll receive separate directories containing the binary content (it won't be included in the CSV files). The file names are constructed from the Salesforce Ids of the corresponding Attachment or Content Version.
The specific data loader that you are using may or may not add functionality around these basic API capabilities.
The Salesforce Data Loader does support loading Attachments, populating the Body column in your CSV with a reference to the file location on your hard drive.
When not using Bulk API mode, it will also extract Attachment Body content to a CSV column, but you should be aware that most spreadsheet applications cannot handle more than 32,000 characters in a CSV cell.
dataloader.io does support import and export of Attachments, using somewhat different semantics than the Salesforce Data Loader.