×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    9

    Unhappy j2me mulitpart File Upload Fail...

    Hi,
    I am developing a j2me application to upload photos to a Rail web
    server.

    I use multipart upload. My code work fine with my local PHP/Apache web server but it failed with the my PHP/Apache hosting server. and when i upload it to my hosting Rail Server, it also show errors.

    I guess it's because of i don't have Content-length header in my POST request.

    I use the following j2me code for my upload:
    http://wiki.forum.nokia.com/index.ph...oad_in_Java_ME

    Please help.

  2. #2
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: j2me mulitpart File Upload Fail...

    - have you tried setting the content-length ? may be you should start with that
    - also, if it works on one server but fails on another, it may come from the server

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: j2me mulitpart File Upload Fail...

    Quote Originally Posted by sok19812003 View Post
    Hi,
    but it failed with the my PHP/Apache hosting server. and when i upload it to my hosting Rail Server, it also show errors.

    I guess it's because of i don't have Content-length header in my POST request.

    I use the following j2me code for my upload:
    http://wiki.forum.nokia.com/index.ph...oad_in_Java_ME



    Please help.
    What error dialog does it displayed?
    Let us know the exact message that the device is displaying.
    Are you sure that the server was accssible from the client and you are using the correct URL in order to access the same.

    Did you got the response code from the server and what is that?
    Try to debug the code on both of the side and check that the server is working.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Registered User
    Join Date
    Dec 2010
    Posts
    9

    Re: j2me mulitpart File Upload Fail...

    The Ruby on Rails Serv er replied with "Bad content body"

    The PHP/Apache server don't say anything, but it just can't receive the parameter i sent to it. It always show as null.
    For PHP, i think it's because on the hosting server, they noramlly use mod_security which has strict rule on POST request like "content-length"...


    Quote Originally Posted by raj_J2ME View Post
    What error dialog does it displayed?
    Let us know the exact message that the device is displaying.
    Are you sure that the server was accssible from the client and you are using the correct URL in order to access the same.

    Did you got the response code from the server and what is that?
    Try to debug the code on both of the side and check that the server is working.

  5. #5
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: j2me mulitpart File Upload Fail...

    Quote Originally Posted by sok19812003 View Post
    For PHP, i think it's because on the hosting server, they noramlly use mod_security which has strict rule on POST request like "content-length"...
    then may be you should start by trying with the content-length header?

  6. #6
    Registered User
    Join Date
    Dec 2010
    Posts
    9

    Re: j2me mulitpart File Upload Fail...

    Quote Originally Posted by njzk2 View Post
    - have you tried setting the content-length ? may be you should start with that
    - also, if it works on one server but fails on another, it may come from the server
    Yes, i try to set the content-length also. but It still failed.

    Yes, It works on one server but not on the other. I think it's because on the production hosting server it's more strict. It use MOD_security apache module.

    So i think there's some problem with the header i sent that's y the hosting server rejected it. BUT I CAN'T FIGURE OUT WHAT WENT WRONG.

  7. #7
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: j2me mulitpart File Upload Fail...

    according to this post https://rails.lighthouseapp.com/proj...in-file-upload can you check your rail server ? there may be something wrong there (like, for example, implement the post on an html page and see if it works) are you using rack for the file upload?
    as for php, i don't know. you are sure nothing is received?

  8. #8
    Registered User
    Join Date
    Dec 2010
    Posts
    9

    Re: j2me mulitpart File Upload Fail...

    Quote Originally Posted by njzk2 View Post
    according to this post https://rails.lighthouseapp.com/proj...in-file-upload can you check your rail server ? there may be something wrong there (like, for example, implement the post on an html page and see if it works) are you using rack for the file upload?
    as for php, i don't know. you are sure nothing is received?
    Many Thanks for your help. I have tried this fixed also. but it seem not working. I'll try with my Rails Upgrade Rail 3. Hope that will help

Similar Threads

  1. how to upload/download file to FTP server in J2ME
    By shahzad73 in forum Mobile Java General
    Replies: 4
    Last Post: 2011-02-24, 09:54
  2. Replies: 5
    Last Post: 2010-10-18, 09:18
  3. File Upload in j2me
    By geetanjalip in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2009-12-10, 12:31
  4. why did i fail in exporting phonebook to a file?
    By snakeninny in forum Symbian
    Replies: 7
    Last Post: 2009-05-25, 10:08
  5. upload file image to server using J2ME (Please Help)
    By afuafu in forum Mobile Java General
    Replies: 3
    Last Post: 2007-05-27, 15:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×