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
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.
Related
I was looking to create a http2 streaming client in C which is able to connect to server, create stream and keep listening for messages from server on that stream without cancelling the stream unless explicitly cancelled or network issue.
I was trying to implement it via libcurl but seems there is no such support in libcurl, at best what I can do is just make a request with curl and not have a timeout. Then curl will just sit there waiting for the transfer to start or complete, until the server does that. And when one transfer is done, the client can just issue another request and go back to waiting...
But I just want to maintain the stream rather than issuing another request to server after receiving message.
I don't want to use GRPC which provides similar functionality but along with it comes lots of complexity of libs and platform dependencies to be resolved.
Is there any other C based library or any http2 stream reference which I should have a look at?
I need to somehow enable XML file transfer in the way that some machine, which generates a XML file sends the XML file through HTTP to another client. This other client would be based on C, receive the XML file and process it.
Is this possible in any way? I only found results for sending XML files to a HTTP server using some URL. I guess I'd have to implement my own HTTP server in my C application? Any ideas?
maybe you can use libcurl
here is a http POST example: http://curl.haxx.se/libcurl/c/http-post.html
on the receiving computer has to be a listening socket. here is a socket example: http://www.codeproject.com/Articles/586000/Networking-and-Socket-programming-tutorial-in-C
this socket takes the incoming data for later processing...
My robot has a web-based Lua IDE, and now I send the script contents with a GET request, Base64 Encoded. But for some reason, my server sometimes only decodes a part of the file, and sometimes it works just fine with a way longer file. I've written the server myself in C++ (it's on GitHub
), and it uses libmicrohttpd
Is there a more reliable way of sending files through a HTTP request than the method I'm using right now?
Is it possible to allow HTTP clients to USE HTTP POST (with Content-Type: multipart/form-data) to upload image files to an IIS 7.5 virtual directory without writing server-side code?
Without server-side code, that is not possible. If HTTP POST is a requirement, you need to write code. Otherwise, configure an FTP site on your IIS installation.
If you really need HTTP, consider WebDav:
http://www.windowsnetworking.com/articles_tutorials/webdav-iis.html
http://learn.iis.net/page.aspx/350/installing-and-configuring-webdav-on-iis/
If you enable public write access in IIS with WebDAV, you can upload files using HTTP PUT requests.
More info.
There are lots of different WAYS you can handle this on the server side ... but all of them involve writing some kind of "code".
SUGGESTION:
Maybe a little asp.net script might be the ticket?
http://msdn.microsoft.com/en-us/library/aa479405.aspx
I want to implement proxy support (SOCKS5 and HTTP CONNECT method) in my application. There are two parts that needs to be implemented:
Detection of proxy details (protocol, host, port): I am using libproxy for that.
Connecting to the the proxy server and telling it to relay the packets. Get the connected socket and then use it in your application.
Is there library for the #2 part?
You might be able to hack libmicrohttpd into doing what you want without too much effort, at least as far as the user end. I'm not aware of anything that does what you want straight out of the box.
Now there is proxysocket (https://github.com/brechtsanders/proxysocket/) to do exactly that.
Supports SOCKS4, SOCKS5 and HTTP CONNECT.
The result is a normal connected socket so you don't have to rewrite the rest of your application.
libcurl can receive webpage via proxy. You can send raw http header to it, and let it talk to the proxy