rem: file = fopen(saveto, "w");
add: file = fopen(saveto, "wb");
context: gboolean DownloadFile(char* saveto, char* filename, int filesize) {	// This function expects that you've already changed the parition and 	// directory to the correct path in the camcorder. dirpath is the Windows	// path to the file to store in.  //  int filesize = global_filesize;  int count,x;  int data;  int round;  FILE* file = NULL;  //char* sfilename = filename;  char sfilename[256];  char buffer[BUFSIZE];  printf("DownloadFile(%s, %s)\n", saveto, filename);  strcpy(sfilename, filename);  file = fopen(saveto, "w");  if (file == NULL) {    Log("Trouble opening: ");    Log(filename);    return FALSE;  }  memset(sfilename, '\0', sizeof sfilename);  strcpy(sfilename,filename);  if(ControlMessageWrite(0xb101, sfilename, strlen(sfilename)+1, TIMEOUT)==FALSE) { //SetFileName    Log("failed at 0xb1");    EnableControls(TRUE);    return FALSE;  }        data=0x00;  if(ControlMessageWrite(0x9301,&data,0,TIMEOUT)==FALSE) { // Request File Read    Log("failed at 0x93");    return FALSE;  }  x=0;  round = 0;  while(1) {    count=Read(buffer,BUFSIZE,TIMEOUT);    x += count;    if (x - round > 65536) {      set_progress_bar((double)x / (double)filesize);      round = x;    }    set_bitrate(x);    fwrite(buffer, 1, count, file);    if(count<BUFSIZE)      break;  }      fclose(file);  Log("Success retrieving file");  return TRUE;}