File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes PHP and the fly likes PHP script to upload file to HTTP server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » PHP
Bookmark "PHP script to upload file to HTTP server" Watch "PHP script to upload file to HTTP server" New topic

PHP script to upload file to HTTP server

wand drew

Joined: May 26, 2011
Posts: 6
I need to do a PHP script to accept file upload on HTTP server and to save it on the server. In fact, I want to upload a file on http server from a j2me application.
I read many ideas, forums and articles but I don't know how to do the server side part, so the php script which supposes to accept my file and save it on the http apache server.

I tried to do something like this:

And my j2me code for uploading file is:

Also, I tried this example: but the script doesn't report anything.
Or maybe I don't know how to use these scripts. If there is somebody who can explain it to me or show me a php script which saves a file on a http server I will be very happy.
Joe Areeda
Ranch Hand

Joined: Apr 15, 2011
Posts: 331

I'm not familiar with the Nokia java environment but the fact that you don't see the length of your audio file makes me suspect it.

May I suggest you debug these things separately. A simple html page like:

Will allow you to test the php code from a browser.

For some reading you might try

Once that is working you might post the java part in the javaME forum where someone more familiar with that might see it.


It's not what your program can do, it's what your users do with the program.
I agree. Here's the link:
subject: PHP script to upload file to HTTP server
jQuery in Action, 3rd edition