All Collections
Flatfile Data Exchange Platform
Guides
How to Retrieve the File Name of the Imported File
How to Retrieve the File Name of the Imported File
Elisa Dinsmore avatar
Written by Elisa Dinsmore
Updated over a week ago

You may encounter scenarios where you want to retrieve the original file your users uploaded. Please note that this file will differ from the data in the review table that your users have mapped and transformed; it will only be their original file.

You can use the Files endpoint, filtered by your spaceId, to retrieve the file and information about the file they uploaded. If you're working in an embedded space where your user is typically only going to import one file, this is pretty simple!

            const files = await api.files.list({ spaceId });
const { name, id } = files.data[0];

If you are expecting your user to possibly import multiple files, you'll want to grab the name and id from each file in the array of files returned by the files endpoint.

To then download that file, you can use our Download File endpoint, using the fileId you just retrieved to download that file.

Did this answer your question?