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

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -