Hi everyone! Is there a way/command in C to find a string that is contained in a longer string? I'm currently developing a C program in Windows that sends requests to a machine and gets its response through socket programming. The response is an image in jpeg/jfif format. The whole response looks like the one below:
Received data is:
HTTP/1.1 200 OK SERVER: Network Camera Date: Thu, 01 Jan 1970 00:01:14 GMT Content-Type: image/jpeg Content-disposition: filename="something.jpg" Connection: close
I want to receive the image sent to me and it should be viewable. I tried to write the whole string above into a .jpg file but no image can be seen. I'm thinking of 2 possible solutions:
1. I might need to just get the "filename=something.jpg" part and save it as a .jpg file.
2. Also from some sources I read in the past, what I need to get are the bits that compose the jpeg file itself.
Does anyone here know which option would most likely solve my problem? Answers will be greatly appreciated. Thanks!