Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload video to server in android

I want to upload file to server in android ,i am using the same code given here but when i run the code i get a : java.net.SocketException:Permission Denied exception at line:
dos = new DataOutputStream(conn.getOutputStream());

EDITED:

one thing more that if a server requires authentication (means if the server requires some username and password to log in first and only then you can upload the files example:Amazon s3 ) then what changes i have to make in the same code.

what should i do.please help.

Thanks

like image 544
Tushar Agarwal Avatar asked Jan 27 '26 16:01

Tushar Agarwal


2 Answers

have you added internet permission to you manifest file?

<manifest xlmns:android>
     <uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>

I think the problem lies there

like image 99
J. Maes Avatar answered Jan 29 '26 04:01

J. Maes


Add this line to your app manifest

<uses-permission android:name="android.permission.INTERNET" />
like image 31
Anton Avatar answered Jan 29 '26 04:01

Anton