Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

PHP script to upload file to HTTP server

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
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: http://wiki.forum.nokia.com/index.php/HTTP_Post_multipart_file_upload_in_Java_ME 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.
Thanks!!
 
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 http://www.w3schools.com/php/php_file_upload.asp

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

Joe
 
I want my playground back. Here, I'll give you this tiny ad for it:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic