You Are Here:

Community: Developer Discussion Boards

#1 Old Lightbulb httpconnection - unable to send data more than 1 mb - 2009-06-29, 12:08

Join Date: Jun 2009
Posts: 11
mt.jijo
Offline
Registered User
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 !
Reply With Quote

#2 Old Re: httpconnection - unable to send data more than 1 mb - 2009-06-29, 12:15

Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#3 Old Re: httpconnection - unable to send data more than 1 mb - 2009-06-29, 12:37

Join Date: Jun 2009
Posts: 11
mt.jijo
Offline
Registered User
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 !
Reply With Quote

#4 Old Re: httpconnection - unable to send data more than 1 mb - 2009-06-29, 12:42

Join Date: Feb 2008
Posts: 2,543
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Online
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#5 Old Re: httpconnection - unable to send data more than 1 mb - 2009-06-30, 03:08

Join Date: Nov 2007
Posts: 319
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Offline
Forum Nokia Champion
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 ...


Marcelo Barros
Nokia E71, N800, N95 and XM 5800
http://www.croozeus.com
http://wordmobi.wordpress.com
http://jedizone.wordpress.com
Reply With Quote

#6 Old Re: httpconnection - unable to send data more than 1 mb - 2009-07-03, 06:33

Join Date: Sep 2005
Posts: 314
Location: Finland, Helsinki
aaaaapo
Offline
Regular Contributor
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/
Reply With Quote

#7 Old Re: httpconnection - unable to send data more than 1 mb - 2009-07-03, 08:09

Join Date: Jul 2009
Posts: 75
lalitendu_panda
Offline
Regular Contributor
Hi,

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

#8 Old Re: httpconnection - unable to send data more than 1 mb - 2009-07-03, 08:34

Join Date: Jan 2009
Posts: 64
Location: India
Send a message via AIM to pavan.pareta Send a message via MSN to pavan.pareta Send a message via Yahoo to pavan.pareta Send a message via Skype™ to pavan.pareta
pavan.pareta's Avatar
pavan.pareta
Offline
Regular Contributor
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

http://www.croozeus.com/started.htm
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
J2ME encrypt C# decrypt josual Mobile Java Networking & Messaging & Security 13 2008-10-20 05:29
suckho, i have encontered the same problems. Could you tell me how you resolved it? dicson_hu Symbian Networking & Messaging 4 2005-12-09 11:56
unable to send data to imported functions in a dll popeye_luck General Symbian C++ 4 2005-09-13 08:18
Using Bluetooth to send data to a nokia 6310 and then sending it over http studentproject Bluetooth Technology 1 2002-11-01 09:51
Unable to Send SMS abhishekmishra General Symbian C++ 1 2002-05-23 15:11

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia