Question: I'm having a PhoneGap application that downloads a file from my server. The problem is that if I point phonegap FileTransfer.download uri directly to the file, the file can be downloaded. But, if I point the URI of FileTransfer.download to a download.php file that has the following:

```
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".$file);
header("Content-Length: ".filesize($file));
readfile($file);
exit;

```

My phonegap application downloads the file. But it only has 1 byte of data and cannot download the content of my file ( It's a MP3 file ). 

Can someone let me know why this happens? I need to use the download.php file because I'm sending a hash to verify the user credentials before allowing the file to be downloaded. 

I've been working around a few hours on this and couldn't find a solution. Is there a proble m with the fileTransfer.download? Should I make additional settings to it?

Answer: 
I don't understand why you need those intermediate vectors. As far as I can understand you have three vectors and you want to copy the content of the first two to the last one. This can be simply achieve with `std::copy`.

```
vector<vector<char>> v1 = {{'a', 'b', 'c'}, {'d', 'e'}};
vector<vector<char>> v2 = {{'e', 'f', 'g'}};
vector<vector<char>> v3 = {{'h', 'i'}};

std::copy(std::begin(v2), std::end(v2), std::back_inserter(v1));
std::copy(std::begin(v3), std::end(v3), std::back_inserter(v1));

```
I think I understand what you are getting at - you want something like this:

```
vector<vector<char>> tmp_fof;
vector<char> first_of_first;

first_of_first.insert(first_of_first.end(), tmp_fof.at(1).begin(), tmp_fof.at(1).end())
first_of_first.insert(first_of_first.end(), tmp_fof.at(1).begin(), tmp_fof.at(1).end())

```