cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Write-out to file?

From: Young,Jim <Jim.Young_at_cerner.com>
Date: Thu, 20 May 2010 08:40:24 -0500

Alec wrote:
>I'm utterly new, but already really impressed by the functionality and ease of use of cURL. I am currently using it in conjunction with a Filemaker Pro database to >send (and get) files via ftp and http. That is, I run a Filemaker script that sends a cURL command to the windows command line. What I do want Filemaker to be >able to do, though, is work out whether a certain process (say, uploading a file to an ftp) has been successful. I'm not expecting cURL to fail, but it's perfectly >possible, for example, for someone to tell cURL to upload a file that doesn't exist. So really, I want cURL to create a txt file giving write-out details. Filemaker could >then import this file and work out if the transfer went down OK. I optimistically tried using -o after my -w but unsurprisingly that didn't create a file with the write >out in. Is there any other way to do it?

I work in a UNIX environment so I don't know for sure that this would work in the Windows world, but you might have a look at the curl -w/--write-out option. I think you could use

curl .... -w "%{size_upload}\n" > results.file

to print the size of the uploaded file and redirect that into results.file.

The other thing I check is the exit status. If it's zero, it worked.

Jim Young

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.

-------------------------------------------------------------------
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 2010-05-20