×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    17

    Lightbulb httpconnection - unable to send data more than 1 mb

    Hi guys,

    import httplib, urllib, e32, appuifw

    def send_data(): #function to send the data to the server.

    f=open('e:/file1.txt','rt')
    test1=f.read()
    params = urllib.urlencode({'data': test1})
    headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"}
    conn = httplib.HTTPConnection("www.myadd.com")
    conn.request("POST", "/pys60/set_txt.php", params, headers)
    conn.close()
    e32.ao_yield()
    appuifw.note(u"Data sent", "info")

    def quit(): #exit function
    script_lock.signal()

    appuifw.app.menu = [(u"send data", send_data)]

    appuifw.app.exit_key_handler = quit
    script_lock = e32.Ao_lock()
    script_lock.wait()

    this is the code i am using for data sending from pys60 to server.

    the problem is i am not able to send data more than about 1 mb at a time.

    i want to send more data around 5-10 mb

    can somebody help me

    Thanks
    Cyan !

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: httpconnection - unable to send data more than 1 mb

    hello mt.jijo

    whats the error you are getting when you are sending that huge amount of data to the server. Actually long ago i also faced that sort of problem when uploading some photos using Python but that was my connection problem.

    So what error you are getting??

    regards
    Gaba88

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    17

    Re: httpconnection - unable to send data more than 1 mb

    hi Gaba,
    i am getting a connetion timed out error when i tried with 5 mb of data but it works fine for 1 mb and less
    is there any data limit for httpconnection?

    Thanks
    Cyan !

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: httpconnection - unable to send data more than 1 mb

    Quote Originally Posted by mt.jijo View Post
    hi Gaba,
    i am getting a connetion timed out error when i tried with 5 mb of data but it works fine for 1 mb and less
    is there any data limit for httpconnection?

    Thanks
    Cyan !
    hello mt.jijo

    oh i guess that is a connectivity problem only but i am not aware of the limitations of httplib when it comes to uploading of data.

    BTW if you are uploading some sort of images or higher size data then you need a different php script at the server.

    Moreover there are some more methods at the wiki which help in uploading the data, do check them.

    Regards
    Gaba88

  5. #5
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: httpconnection - unable to send data more than 1 mb

    Hi all !

    Two suggestions:

    • Increase application heap (how is your heap size ?)
    • Make a raw socket connection (instead using urllib) and send the file in chunks.


    I dont know if we have such limit in urllib ... searching ...

  6. #6
    Regular Contributor
    Join Date
    Sep 2005
    Location
    Finland, Helsinki
    Posts
    323

    Re: httpconnection - unable to send data more than 1 mb

    Quote Originally Posted by mt.jijo View Post
    i am getting a connetion timed out error when i tried with 5 mb of data but it works fine for 1 mb and less
    There may be several limits on the server, e.g. if you are using Apache + PHP on the server side:
    - max_execution_time
    - max_input_time
    - post_max_size
    - upload_max_filesize

    Other web servers may have similar limits.
    --
    Aapo Rista
    http://code.google.com/p/pys60gps/
    http://opennetmap.org/

  7. #7
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    81

    Re: httpconnection - unable to send data more than 1 mb

    Hi,

    Its not the probelm in http connection .If u r using gprs then its not possible to send heavy size of data .

  8. #8
    Regular Contributor
    Join Date
    Jan 2009
    Location
    India
    Posts
    138

    Re: httpconnection - unable to send data more than 1 mb

    Hi mt.jijo,

    You have to send data over server chunks by chunks it mean you have to fixed chunk size like 100 KB or so on.

    hope this may be help.
    Pavan Pareta
    Sr. Software Engineer
    http://windows-mobile-dev.blogspot.com

Similar Threads

  1. J2ME encrypt C# decrypt
    By josual in forum Mobile Java Networking & Messaging & Security
    Replies: 13
    Last Post: 2008-10-20, 04:29
  2. suckho, i have encontered the same problems. Could you tell me how you resolved it?
    By dicson_hu in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2005-12-09, 10:56
  3. unable to send data to imported functions in a dll
    By popeye_luck in forum Symbian
    Replies: 4
    Last Post: 2005-09-13, 07:18
  4. Using Bluetooth to send data to a nokia 6310 and then sending it over http
    By studentproject in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-11-01, 08:51
  5. Unable to Send SMS
    By abhishekmishra in forum Symbian
    Replies: 1
    Last Post: 2002-05-23, 14:11

Posting Permissions

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