uploading wav file problem

i tried to upload wav file which is 1000000 about 1minutes....
it is connected with wifi...
i used this code...

if (myFile) {

byte clientBuf[1024];
int clientCount = 0;

while(myFile.available())
{
clientBuf[clientCount] = myFile.read();
clientCount++;

if(clientCount > 1023)
{
// Serial.println("Packet");
client.write(clientBuf,1024);
clientCount = 0;
}
}
//final <64 byte cleanup packet
if(clientCount > 0) client.write(clientBuf,clientCount);
// close the file:
myFile.close();
}

but i could not upload....
i think this is the size problem...
because just 2seconds wav file uploaded well...
is this because of small ram?

is there any way to upload this on the server using arduino ?
suggest me...
i worried this problem from the start ... but i heard it is possible...

have a nice day!
thank you for reading....

i used this code...........
but i could not upload

Not surprising, that code will not compile. It has no structure, that is not the way you program code in an Arduino.

Go back to basics and try some simple tutorial examples, learn to crawl on your belly before you try a sprint.

that is the part of my file.
i succeded in uploading txt, jpg file... about 10k
but there is a problem to upload big size file.
so that ...
is there a limit for uploding size ? even though spliting the file ?

Your problem might be in the server's side.

Some HTTP servers may have configured a limit size per file (for simple "upload file" forms); if it's the case, the attempt will be immediately rejected. Another issue could be timeout, if the upload process takes too long, the server suddenly closes the connection.
If you can't change those parameters, then splitting the file should do the job.

If it's an FTP server, this shouldn't happen in most cases.
If you are sending UDP packets, it's even more difficult to track the problem. Or maybe because you are exceeding the maximum payload's size per packet, either by protocol or router's current workload (on TCP this is not an issue).

I don't know exactly why, but at least you should mention where are you trying to send those files.

sorry ... i thought it is enough to mention 'server'
i use an apache server...and sending data by phpoc

but i also thought it might be a problem because of the maximum size of server side.
so i already fix both of them...

i rethink again ... about your other advices ...

if you have another solution ,,,

please let me know....

thank you for your answer .

i really appreciated it

I bet it's on the server side, because the Arduino or ESP can be sending data as long as needed; it's up to the other part to decide if it will keep the connection alive that long.

Unlike UDP (where you have to define the payload beforehand), a TCP connection or "socket" automatically handles all the packet juggling, along with the guaranteed data transmission; making it as easy to use as the serial communication. So definitely this isn't the problem here.

PD: timeout can be an issue due to the actual upload speed of the device. Like if the Wi-Fi's possible self slowdowns weren't enough, you still can't expect high speeds on an Arduino or ESP; even when both parts are located on the same LAN.
From an Arduino Uno, you can realistically expect at most 300 Kbps; and from an ESP8266 at most 2 Mbps.

rucario i think you are right... i changed to ftp from apache ...
it seems work well.
but i can not find the reason why apache with php does not work...
thank you again. ^^

fineaplus:
but i can not find the reason why apache with php does not work...

Timeout is more likely the reason, since HTTP wasn't designed to hold a TCP connection for long.
In normal browsing, the connection is closed as soon as the page is completely loaded or canceled (also applies for bigger file downloads, e.g. compressed/archived files, software installers, etc.); although AJAX and other JavaScript stuff might be creating more connections in order to make the page look more "dynamic", but that's another history.