WISHY
WISHY

Reputation: 11999

Upload large files to server in android?

I am using the following example to upload video to server.

UPLOAD AUDIO VIDEO IMAGE

However I am not able to upload large size video files say more than 2 MB.

Any other example would help me if possible? Or is there need to be any change in the above code?

Upvotes: 1

Views: 7136

Answers (3)

hardik lakhani
hardik lakhani

Reputation: 45

i think you should try android:largeheap="true" in manifest file

<application
    android:allowBackup="true"
    android:largeHeap="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" 

Upvotes: -1

Jay Vyas
Jay Vyas

Reputation: 2712

Use this code.tutorial

Through this code you can upload files upto 10mb.

Upvotes: 1

Mike Garcia
Mike Garcia

Reputation: 2122

The limit is not set in your PHP script, but in the global server settings. If you have access to php.ini, check the values for upload_max_filesize and post_max_size. You will need to restart Apache after updating php.ini.

If you don't have access to php.ini (e.g. shared hosting) and the host allows it, you can try setting the limits writing something like this in your .htaccess:

php_value upload_max_filesize 10M
php_value post_max_size 10M 

You can check the server settings using the phpinfo() function (http://www.php.net/manual/en/function.phpinfo.php)

Upvotes: 2

Related Questions