curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: I cannot upload my file through an API via cURL?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 12 Apr 2017 08:20:16 +0200 (CEST)

On Wed, 12 Apr 2017, Afu Ra via curl-users wrote:

> I am using the following cURL command to imitate these requests to POST my
> firmware file over to the computer:
>
> *curl -i -X POST -d @"C:\Users\name\Documents\firmware/firmwarefile"

First, avoid the -X:

  https://daniel.haxx.se/blog/2015/09/11/unnecessary-use-of-curl-x/

Then, as you want multipart formposts you want -F and not -d:

  https://ec.haxx.se/http-postvspost.html

> Am I posting my file correctly? I don't understand why the firmware file is
> not being pushed through.

I'd like to refer to the "HTTP multipart formposts" section of the curl book
first and if there's anything unclear after you've read that, please ask
specify and I'll try to elaborate in a response or clarify the book chapter...

  https://ec.haxx.se/http-multipart.html

-- 
  / daniel.haxx.se
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-04-12