Dear Coders,
I need a java applet to read a file from client machine and creat a POST request for PHP server uploading.
It will be nice PHP receive the file as normal file upload in FORM submit. But if some encoding decoding is required. you should also provide the PHP part
I am using the following code. The file contents are passed to PHP script
but they are not correctly converted to an image.
//uploadURL will be a url of PHP script like
// <[login to view URL]>
URL url = new URL(uploadURL);
HttpURLConnection con = (HttpURLConnection)[login to view URL]();
[login to view URL]("POST");
[login to view URL](true);
[login to view URL](true);
InputStream is = new FileInputStream("C://[login to view URL]");
OutputStream os = [login to view URL]();
byte[] b1 = new byte[10000000];
int n;
while((n = [login to view URL](b1)) != -1) {
[login to view URL]("hello" , 0, 5);
test += b1;
}
[login to view URL]();
The code must work in a Java Applet on client machine.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
My hosting server is linux based with PHP/Mysql.
Client can have any operating system/Browser