How to declare and use a large array?

Hi, I am trying to declare a large array to store the data get through the http.
when i declare it uint8_t Image_data_buffer[5808]; before setup(). the whole program does not work.
and I can declare it at the begining of the loop() as follows second part of the codes, it works, I can see the date on COM.but when i want to use this large array like this first part of the codes. even the program did not realy step in this part. the http get request will fail. what wrong ? help me,Thanks a lot!

 for(number_frame=0;number_frame<92;number_frame++)
       {
        Serial_rx_data[0] = number_frame;
        for(uint16_t i=1 ;i<data_length+1;i++)
        {
          Serial_rx_data[i] =Image_data_buffer[i-1];
       //   Serial_rx_data[i] =i;
          Serial.print(Serial_rx_data[i], DEC);      
        }   



/*********************************************************************/
   uint8_t Image_data_buffer[5808];
   uint16_t number_buffer=0; 

  if (millis() - lastConnectionTime > postingInterval) {
    httpRequest(); 
  }
   while (client.available()) {
    uint8_t c = client.read();
    if(0xd==c&&client.read()==0xa){
      c = client.read();
    if(c==0xd&&client.read()==0xa)
    {
      Serial.println("start getting the HEX");
      while(1){        
      c=client.read();
      uint8_t high=0;
      uint8_t low=0;
      if (0x30 == c && 0x78 == client.read()) {
        char d = client.read();
        if (d >= '0' && d <= '9') {
          high= d - '0';
        } else if (d >= 'a' && d <= 'f') {
          high= d - 'a' + 10;
        } else if (d >= 'A' && d <= 'F') {
          high= d - 'A' + 10;
        } else {
          high= -1;   
        }
         d = client.read();
        if (d >= '0' && d <= '9') {
          low= d - '0';
        } else if (d >= 'a' && d <= 'f') {
          low= d - 'a' + 10;
        } else if (d >= 'A' && d <= 'F') {
          low= d - 'A' + 10;
        } else {
          low= -1;   
        }
        Image_data_buffer[number_buffer]=(high*16) + low;
        Serial.print(Image_data_buffer[number_buffer],HEX);
        Serial.print(' ');
        number_buffer+=1;
        if(number_buffer==5808)
        {
           break;
        }
      }
      }    
    } 
  }
 }

If the data in the array is constant and known at compile time, put it in PROGMEM.
If it isn't, buy a processor with more RAM

What Arduino are you trying that with?

UNO has only 2K bytes of RAM for everything including the stack.
Leonardo has 2.5K.
Mega2560 has 8K and you can get a memory card to take that up.
What I call Franken-duinos like the Due, Yun and Galileo have 64K and more.

Thank you, I am using UNO. I got it. The problem is the size of ram.
what is the deffience of declaring the array before sutup and in the loop?
the ram is not enough. but how it works when I use the arrary to receive the data from http and print through com?
Thanks.

Do you really need to process 8K at a time?

No. it is not necessary, i can change the code.

So you run a data stream through the Arduino and what do you do with the results?
Almost all data processing works down to that and much of the time it goes on and off a drive.
You can and maybe already have SD in your project.

Depending on what you are doing with the information, if it is word-based matching then you can store the match data in the UNO flash using PROGMEM and run analysis even down to a character at a time. I prefer that but it's not for everyone.

If being able to have the whole array is a big bonus then you could build a 1284P breadboard duino to connect to the UNO and process on that. The 1284P has 16K RAM and costs about $7. The howto is the 2nd half of this blog:

Connecting through the UNO lets you use the USB and shield.

Or just use a '1284P based board:
http://www.crossroadsfencing.com/BobuinoRev17/

The Bobuino is shield-compatible, isn't it?

Yes.

Waiting on another batch of cards to come in. Have all the parts to kit them up, PCBs have left the factory and should arrive any day.