cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Beginner question: Remote filename - SOLVED

From: Petr Lázňovský <lazna_at_volny.cz>
Date: Sun, 16 Mar 2014 10:56:53 +0100

There is one more hidden form field called "fname" which giving the filename to the server. It this field is used, no ";filename=config.bin" is necessary.

Thanks for your time, L.

>> On Sat, Mar 15, 2014 at 07:53:13PM +0100, Petr Lázňovský wrote:
>>> Following command send form content and file to the cgi script. It works fine, but filename in the server is "1file" instead of "config.bin" even if I set remote name by: -F "f1=@config.bin;filename=config.bin"

>>> what am I doing wrong?

>>> thanks, L.

>>> curl -F "cmd=newticket" -F "do=1" -F "name=Joe" -F "email=Joe@Blow.com" -F "subject=this is my subject" -F "problem=text message" -F "name=f1" -F "f1=@config.bin;filename=config.bin" "http://sub.host.com/xxx.cgi"

>> What version of curl are you using? The latest one does the expected thing for
>> me, as this excerpt from --trace-ascii shows:

>> 0269: --------------------------48daa29ab55def9f
>> 0295: Content-Disposition: form-data; name="name"
>> 02c2:
>> 02c4: f1
>> 02c8: --------------------------48daa29ab55def9f
>> 02f4: Content-Disposition: form-data; name="f1"; filename="config.bin"
>> 0336: Content-Type: application/octet-stream
>> 035e:

>> If the server is turning this into a file called "1file", then it sounds like
>> it's completely up to the server and doesn't have much to do with what
>> metadata it gets sent.

> C:\curl.exe --version
> curl 7.33.0 (i386-pc-win32) libcurl/7.33.0 OpenSSL/1.0.1e zlib/1.2.7
> Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp smtp smtps telnet tftp
> Features: AsynchDNS IPv6 Largefile NTLM SSL libz

> What you mean by "server", cgi script program called by curl command or IIS itself?

> L.

> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-03-16