cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Problem with cURL via UNIX, and 0 byte files

From: Art Norman <art_at_rsss.com>
Date: Mon, 6 Nov 2006 16:07:14 -0600

Steve: One way we have addressed a similar issue was to have the
applications on both sides to always process a file with a header and/or
trailer record in it. This also allowed us to send a record count for
additional file transmission validation. If there was no data then we
would just transmit a file with only a header and trailer with a record
count of zero. Hope this helps, or at least provides an alternative.
We would also be interested if there is a cURL option to prevent sending
an empty file. Thanks Art

-----Original Message-----
From: curl-users-bounces_at_cool.haxx.se
[mailto:curl-users-bounces_at_cool.haxx.se] On Behalf Of steve
Sent: Monday, November 06, 2006 3:32 PM
To: curl-users_at_cool.haxx.se
Subject: Problem with cURL via UNIX, and 0 byte files

Howdy folks,

Total cURL newbie here. We're trying to use cURL via a UNIX shell
script, to post a file to an HTTPS site. We're using the following
syntax:

curl -f -F "Username=xxx" -F "Password=xxx" -F "UploadFile=@data.txt"
https://url.aspx -o results.html

Obviously, the details have been changed to protect the innocent. :)
Generally, this is working fine. Our UNIX script generates the data.txt
file daily, and the cURL sends the file to our vendor.

In testing, however, we realized that if the data.txt file is not
present on our side, the cURL will still send a 0-byte data.txt file.
Are there any options within the cURL syntax that would prevent the cURL
from sending a file if no local file exists? For now, we're just writing
additional UNIX code to prevent the cURL from executing if the file is
not present. But, I was just curious if there was anything within cURL
that would take care of this.

Thanks!

Steve
Received on 2006-11-06