Missing extension in file upload to wordpress. How to fix?

Describe the problem/error/question

Hi all,

I’m trying to fetch an image from Unsplash, Upload it to Wordpress and set it as featured image in a wordpress post. And it works, almostish…

It uploads the image to Wordpress, however it doesn’t add the file type after the file upload.
For example it uploads image: x123 but is missing the filetype for example .jpg so it becomes

Any ideas on how this could be added to this flow?
I think things need to be fixed on Upload to Wordpress node.

Please share your workflow

Hi @Mec, I am sorry you’re having trouble. It seems your example workflow relies a lot on data not included in the example.

Is there a chance the image doesn’t come with the extension in the file name field when downloading? n8n does unfortunately not process the content-disposition header when downloading something, so you might need to rename your file first before processing it further. I’ve shared an example a while back over here:

Hey @Mec

The workflow can be a little simpler. The first HTTP node downloads the image from Unsplash, the second uploads it to the WordPress instance and the third adds the image as a featured image in the post with indicated ID.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.