Answer the question
In order to leave comments, you need to log in
What does the @ symbol mean in a file path?
I encountered a strange error when working with an external API - if the path to the file is without the @ symbol, then everything works fine:
curl -k --location --request POST 'https://api.example/file-load/' --header 'Content-Type: multipart/form-data' --form 'filedata=/var/www/file.jpg'
{"message":"Файл с успешно загружен"}
curl -k --location --request POST 'https://api.example/file-load/' --header 'Content-Type: multipart/form-data' --form '[email protected]/var/www/file.jpg'
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>413 Request Entity Too Large</title>
</head><body>
<h1>Request Entity Too Large</h1>
The requested resource<br />/file-load/<br />
does not allow request data with POST requests, or the amount of data provided in
the request exceeds the capacity limit.
</body></html>
All data sent in an HTTP POST request. To transfer a file, precede the file name with @ and also use the full path to the file.
Answer the question
In order to leave comments, you need to log in
man-curl
[...] To force the 'content' part to be a file, prefix the file name with an @ sign.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question