upload to server... limit size ?

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

upload to server... limit size ?

Postby Sly17 » Sat May 09, 2009 5:36 pm

Hi,
Is there a limit size for the uploads ?

I upload files from emulator to a server (with PHP code) and for the files < 4Mo all is perfect, but for files > 4Mo I have a out of memory pb... is this normal ?

For info I use this tuto upload_files_to_web_server-t443-s30.html

My error is :
05-09 16:20:53.977: ERROR/dalvikvm-heap(1539): Out of memory on a 4175993-byte allocation.
and
05-09 16:20:54.045: ERROR/AndroidRuntime(1539): Uncaught handler: thread Thread-9 exiting due to uncaught exception
05-09 16:20:54.055: ERROR/AndroidRuntime(1539): java.lang.OutOfMemoryError
05-09 16:20:54.055: ERROR/AndroidRuntime(1539): at java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:138)
...

Someone can help ?
User avatar
Sly17
Junior Developer
Junior Developer
 
Posts: 10
Joined: Thu Jan 01, 2009 9:11 pm

Top

Postby Sly17 » Sat May 09, 2009 10:27 pm

Oki setChunkedStreamingMode() function can be use for the connection and to avoid this pb...
...it's seems that it's ok emulator side, but what the hell PHP server side ?
What is the new function to use ?

What is the new fct instead of
Code: Select all
<?php

$folderPath = "./upload/"

if( !move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $folderPath . $_FILES['uploadedfile']['name']) )
{
   exit("  Impossible to copy.");
}

exit("  Oki !");

?>
User avatar
Sly17
Junior Developer
Junior Developer
 
Posts: 10
Joined: Thu Jan 01, 2009 9:11 pm

Postby padde » Sat May 09, 2009 11:44 pm

The max upload size is set in the php config file
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby Sly17 » Sun May 10, 2009 9:09 am

Oki, then this side is ok because the php.ini limitation is 24Mo and the limitation with my code is over 4Mo !
User avatar
Sly17
Junior Developer
Junior Developer
 
Posts: 10
Joined: Thu Jan 01, 2009 9:11 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Google Feedfetcher and 4 guests