user1196792
user1196792

Reputation: 66

sending file from client to http server in c programming

i have to write c program in which the file can be transfer to server , we have the http url link for that.what we have to do for sending and receiving file/data. Actually i have to send file to http server , on calling url the file will be transfer.it's like that when user click on send the text file will transfer to that server. help so some light ..any link that i can get help .thanking you

Upvotes: 1

Views: 3865

Answers (1)

Celada
Celada

Reputation: 22251

From reading the comments, it sounds like you're going in the direction of using sockets directly. Don't do that. Use an HTTP client library. The basic HTTP protocol is simple enough that the sockets approach is workable for a rudimentary client, but you won't support features like HTTP keepalives, proxy servers, encryption (https), HTTP/1.1, compression, chunked encoding, or 100 continue without completely reinventing the wheel.

Use libcURL. When writing in C, uploading a file to an HTTP server is only a few dozen lines of code, including boilerplate.

Upvotes: 1

Related Questions