servlet in php for applet

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Wed Sep 04, 2013 9:24 am

servlet in php for applet

Postby Elefante » Wed Sep 04, 2013 9:31 am

I have an applet that I miss the servlet.
I thought about using a php file instead.
The file is activated but I do not receive the file sent by the applet.
How can I do?

The applet:

Code: Select all

public boolean invokeServlet(String baseUrl, File pdfFile, String
formName, String tipoDoc, String sessionId)
throws Exception
URL url = new URL((new
StringBuilder(String.valueOf(baseUrl))).append("/ScannerServlet").toString()); connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection)connection;
httpConn.setRequestProperty("Cookie", (new
httpConn.setRequestProperty("formName", formName);
httpConn.setRequestProperty("tipoDoc", tipoDoc);
OutputStream out = httpConn.getOutputStream();
GZIPOutputStream os = new GZIPOutputStream(out);
int BUFFER_SIZE = 32000;
InputStream is = new FileInputStream(pdfFile);
int bytesRead = 0;
byte buffer[] = new byte[32000];
while((bytesRead = != -1)
os.write(buffer, 0, bytesRead);
return httpConn.getResponseCode() < 300;

The data that i receive:

php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: servlet in php for applet

Postby johnj » Sun Sep 08, 2013 2:56 am

where is the php file?

New php-forum User
New php-forum User
Posts: 2
Joined: Wed Sep 04, 2013 9:24 am

Re: servlet in php for applet

Postby Elefante » Sun Sep 08, 2013 5:58 am

file_put_contents("file.txt", serialize($_REQUEST));

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest