16.04.2014, 03:14
Best way to load a 2MB file in memory
I have a log file that's around 1 to 2 megabytes in size which I want to send to my website using the SA-MP HTTP function. It seems the only way to accomplish this is by reading the entire log file into memory, and then using the HTTP function to send the data to my website.
So my question is, what's the best way to load the entire log file into memory in order to send it to my website via HTTP post request?
Also, I would like to limit the number of HTTP request to one request, if possible, because I'm currently using a free web host for my website.
I have a log file that's around 1 to 2 megabytes in size which I want to send to my website using the SA-MP HTTP function. It seems the only way to accomplish this is by reading the entire log file into memory, and then using the HTTP function to send the data to my website.
So my question is, what's the best way to load the entire log file into memory in order to send it to my website via HTTP post request?
Also, I would like to limit the number of HTTP request to one request, if possible, because I'm currently using a free web host for my website.