Add file extension for infile

I need to keep the file extension when loading a temporary file for filters.
I use this for integrating with require.js