No such file or directory, open image.jpg

hello!, I’m executing a node http request, but it gives the error: No such file or directory, open

the file path is: C:\Users\Presley\Pictures\foto_jyselly.jpg

on my windows 10 computer

it’s not a problem with the api I’m using, because I tested it with a url address and it worked, but with the local address it didn’t work

I’m using n8n desktop

sendImage6
sendImage7

How can I do to map the file path?

Hi, I am not sure, but try to write the path in this format:

C:\\Users\\Presley\\Pictures\\foto_jyselly.jpg

or

C:/Users/Presley/Pictures/foto_jyselly.jpg

let me know if it worked!

did not work
sendImage8

sendImage9

it seems to me that n8n does not find the path, maybe it has to map the absolute path, but I do not know how

another option would also be

but it gives the following error:

okay, actually I don’t know how to test well cause I don’t have Windows.

I suggest you to check if the file is the correct position
and If yes, try to read again the documentation maybe there is something missing.
Sorry!

Hi There,

It looks like you are just sending a path not the actual contents of a file, Does the API you are using have access to your local machine to be able to read the file or is it expecting you to actually send the file?

the api i am using expects me to actually upload the file

in the second example i use the multipart/form-data

but in the first example i used the application/json

normally for url it works fine but for local file not

Hey @Presley_Nunes_de_Men,

But you are still just sending the path not the file contents, I suspect when you use a URL the system you are working with is calling that URL to download it. When you are sending a filepath it looks like it is trying to read the local path on the server which is interesting and could potentially be a security issue if it is just blindly trying to read something… anyway…

Depending on what the API actually requires before the HTTP Request node add a read binary files node and put in the path to get the file data then send that to the service instead.

I achieved!!

I did as instructed, but I converted it to json and then to base64 and it worked.

Thank you for your help

1 Like

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