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

mysqli - Php Mysqli_fetch_assoc Error : "Warning: Illegal string offset 'name' in" -

html - Cut text on left side inside button while centering -

php - Hide Categories from WordPress Dashboard by ID and Custom Post Type -