I\'ve asked a question here and I\'ve fixed my problem thanks to an user. This is the code I am using at the moment.
void UploadToDatabase() throws MalformedURLE
The problem lies on this line:
WritableByteChannel rbc = Channels.newChannel(website.openConnection().getOutputStream());
You will need to set doOutput
to true
for this to work. Here's how:
URLConnection urlc = website.openConnection();
urlc.setDoOutput(true);
WritableByteChannel rbc = Channels.newChannel(urlc.getOutputStream());