Yun upload file to server

Hi

I am trying to upload a file to the server with an arduino yun. The file is located on the sd card. The server side function gets called succesfully but it doesn't receive a file. The server returns a string "error", "succes", "no file" as result, and it always return "no file". This is my code to send the file. I am trying it with a 'curl' command. (The server side is a .NET MVC project.)

void uploadLogFile(){
  Serial.println(F("Uploading Log File"));
  
  Process post;
  
  post.begin("curl");
  post.addParameter("-X");  
  post.addParameter("POST"); 
  post.addParameter("--d");  
  post.addParameter("file=@/mnt/sd/datalog.txt");
  post.addParameter("http://xxxxxxxx/LogFile/Submit");
  
  post.run();
  
  if (checkProcessResult(post, "succes") == 1){
    Serial.println("File upload succes");
  }

}

Does it work if you run that very curl command?

You can change the normal GET to a POST method by simply adding -X POST in a command line like:

curl -X POST http://example.org/
... but curl will still think and act as if it sent a GET so it won't send any request body etc.

http://curl.haxx.se/docs/httpscripting.html#POST

I am a relative novice ... I am also trying to upload a file to the server with an Arduino yun . The file is on the SD card. I have not been successful , if anyone has an example would appreciate ( The server side use PHP)

Minor:
I am a relative novice ... I am also trying to upload a file to the server with an Arduino yun . The file is on the SD card. I have not been successful , if anyone has an example would appreciate ( The server side use PHP)

Post your code. Please use markup.

Jesse

arduino_markup.png