I believe that the problem may be with my readfunction, but I don't know what else it would have to have to work. Any help would be GREATLY appreciated. Thanks!
I'm not sure what you meant to do on lines 13-14, but if a is an std::string, a[a.size()] is always zero, so if libcurl initialized buf to zero, the function will always return immediately.
I also tried if (c>=data.size()), but that doesn't work either. size*nmemb is the largest amount of data the buffer can hold, and "c" is in a for loop, up to size*nmemb. If c is greater than the data string's size, then I have reached the end and return 0. Else, I return the number of bytes I "took care of" (size*nmemb).
No matter what I do, the file ALWAYS ends up blank. Its driving me nuts!!!!!!!!!!!
GOT IT WORKING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
For some reason, returning 0 on the first call of the callback will signal some type of error and libcurl won't upload it. I had to return (c-1) and use a bool flag to have the callback get called 2x (returning 0 the 2nd time) to get it to work. If you return 0 on the first time, it doesn't work, and if you don't return 0, the callback is called indefinitely. The error buffer said "unaligned blah blah blah". I'm assuming that was because of me returning incorrect numbers at first.