General
cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer of data using Curl in Binary or Ascii

pk1974
Occasional Contributor

Transfer of data using Curl in Binary or Ascii

Hi

could you please help how to send the data using cURL command in Binary or in Ascii format to remote server

Below is command format I am using to send data, when I send data the customer not able to view the data,

curl -E certificate:pwd -F "userid=usrname" -F "password=pwd" -F "filedata=@filename" https://host:port


could anyone help me

Thanks
11 REPLIES
Patrick Wallek
Honored Contributor

Re: Transfer of data using Curl in Binary or Ascii

>>when I send data the customer

What kind of file? What kind of data?

>>not able to view the data,

Can you be more descriptive? Is the data corrupted? Does the customer receive an error when he/she tries to open the file?
PK_1975
Frequent Advisor

Re: Transfer of data using Curl in Binary or Ascii

When I send the data from unix system, he can able to see the file in the server, but when he view the file, the data is uncorrupted,

same file when I send using windows, he can view the data

OldSchool
Honored Contributor

Re: Transfer of data using Curl in Binary or Ascii

from the cURL man page:

-B/--use-ascii
Enable ASCII transfer when using FTP or LDAP. For FTP, this can also be enforced by using an URL that ends with ";type=A".

PK_1975
Frequent Advisor

Re: Transfer of data using Curl in Binary or Ascii

Hi

I am using Https not FTP to send files
Steven Schweda
Honored Contributor

Re: Transfer of data using Curl in Binary or Ascii

> I am using Https not FTP to send files

Ok, but without showing us what's in the file
before and after it's transferred, you may
need to find someone with psychic powers to
tell you what happened.

Other potentially interesting data:

cURL version
OS version
HTTPS server software description, version
OS where the HTTPS server is running

Can you transfer the file using a Web browser
instead of cURL, and does that change the
result?
PK_1975
Frequent Advisor

Re: Transfer of data using Curl in Binary or Ascii

Yes, If I send the file through Web Browser customer can view the file, but when I send through Unix using curl command he can not view the file. so I have to send the data in Binary or Ascii format using curl command
Steven Schweda
Honored Contributor

Re: Transfer of data using Curl in Binary or Ascii

> [...] so I have to send the data in Binary
> or Ascii format using curl command

As mentioned earlier (so far as I know),
HTTPS does not have ASCII and binary modes.

> Other potentially interesting data:
> [...]

Still potentially interesting. Actual
information about the data in the files would
also still be useful. I could speculate on
what the (unknown) Web browser is doing
differently, but seeing actual data would
probably be more helpful than my guesswork.
PK_1975
Frequent Advisor

Re: Transfer of data using Curl in Binary or Ascii

Hi

I try like this

curl -E certificate:pwd -F "userid=usrname" -F "password=pwd" -F "filedata=@filename;type=A" https://host:port

but it is not working could you please suggest me


OldSchool
Honored Contributor

Re: Transfer of data using Curl in Binary or Ascii

see all the requests for further information and examples.

restating what you did (that didn't work) probably isn't going to be much assistance.

OSes involved, s/w versions and so on might be helpful. examples of what you mean by "can't read" (actual data / results).

you say it works from windows, but not from unix. is the destination windows? is this the ever-popular dos2ux / ux2dos line terminator issue? how would we know as you've provided almost no information
PK_1975
Frequent Advisor

Re: Transfer of data using Curl in Binary or Ascii

Distination is UNIX
Steven Schweda
Honored Contributor

Re: Transfer of data using Curl in Binary or Ascii

> Distination is UNIX

Well. That explains everything.


Count the number of questions you've been
asked, and the other requests for information
from you.

Count your answers (and look at how useless
thay are).

Now, sit back and wonder why you're getting
no help.