Upload pics to a server using c++ -
i'm trying upload photo 1 of our server in c++, following excerpt of testing code
//in main ifstream fin("cloud.jpg"); ofstream fout("cloudcpy.jpg"); string data; while ( fin ) fin >> data; fout << data; fin.close(); fout.close(); return 0;
but output file not copy, more smaller original one. wrong in code?
you may not use string data type. since jpeg file not textfile. please try use primitive type such unsigned char or unsigned int it.
Comments
Post a Comment