General Discussion & Announcements

 View Only
  • 1.  cURL PUT with --data-binary from z/Os

    Posted 01-10-2019 18:20

    I am attempting to PUT a z/OS load module on a Linux system into a repository to be pulled later and run on z/OS. I am using
    curl -X PUT -k -u userid:passowrd
    -v -T --data-binary @/folder/Jzosfile.so
    https://dnsname/path/filename

    I get an error “curl: Can’t open ‘–data-binary’!”. Is this not a valid option on PUT? I see people asking questions about cURL POST with --data-binary but not PUT.

    Any suggestions on how to put a file in binary from cURL? I do it all the time FTP but what I am putting this do does not support FTP.

    Thank you



  • 2.  RE: cURL PUT with --data-binary from z/Os

    ROCKETEER
    Posted 01-14-2019 10:24

    Hi,

    If you use -T or --upload-file option, PUT will be use by default for HTTPS.
    –data-binary is using for POST requests but it can be changed to PUT:
    https://ec.haxx.se/http-put.html
    If you want to upload file on FTP or HTTP server, you need to run:
    curl -u userid:password -v -T /folder/Jzosfile.so “ftp://dnsname/path/filename”
    or
    curl -k -u userid:password -v -T /folder/Jzosfile.so “https://dnsname/path/filename”
    or
    curl -k -u userid:password --data-binary “@/folder/Jzosfile.so” -X PUT “https://dnsname/path/filename”

    The binary transfer mode is default for curl if you are using -T(–upload-file) option.
    But there is an another problem - a bug connected with binary mode. The uploaded file can be coverted to another encoding.
    Unfortunately, this bug is not fixed yet.

    Thanks,
    Sergey



  • 3.  RE: cURL PUT with --data-binary from z/Os

    Posted 01-14-2019 10:53

    Hi Sergey and thank you for the response.

    I am using the -T on my PUT request.

    The product I am doing the upload to Artifactory does not support FTP or I would be using that, with or without cURL.

    What are the results of the -a bug connected with binary mode? I am attempting to determine when this EBCDIC file is being converted to ASCII.

    Regards

    Kevin



  • 4.  RE: cURL PUT with --data-binary from z/Os

    Posted 01-17-2019 11:19

    Hi Kevin.

    Just my 2ct.
    I got a similar problem and over here I had to change the @ to § because of Codepage mismatch.

    regards michael



  • 5.  RE: cURL PUT with --data-binary from z/Os

    Posted 01-30-2019 08:59

    Thank you I saw that in another thread you posted. It was the first thing I tried. I am using a heavy handed work around now. I use FTP bin to put my load modules on a Unix FTP server then a cURL POST from the mainframe that kicks off a script to get it to its build destination. It works and keeps it all in EBCDIC format.