File transfer to remote server. No Bluetooth.
Hi all,
how could I possibly send a larger textfile (around 100kB, possibly ZIP packed) from the phone to a remote server?
I found that Python for Series 60 allows sending SMS or file trasnfers over Bluetooth. Both solutions do not fit my needs since I need to periodically transfer data from the phone to a server. The phones could be everywhere at that time.
Since I can start a commandline tool from Python, I thought there might be a commandline based ftp-client which could be automated.
Any ideas are greatly appreciated. Thanks for reading.
Leif
Re: File transfer to remote server. No Bluetooth.
Half a year later (see my previous post from 2005) and the bug is back again. Oh no! ;(
I had to transfer files via FTP again so I crammed out my old source and was expecting it to work straight away. Guess what, it didn't! Luckily I saved a copy of the old Python SIS files that I used back then so I could compare between versions. I wrote a small program for that purpose.
The following code is known to work on old Pys60 (details in the comments of the code) and on Windows Python 2.3.3. Unfortunately is doesn not work on any of the "1.2 final" releases of Python.
[code]
"""
lxo, 1.3.2006
---
minimalftp.py works on these configurations (they are all obsolete!):
Windows (2.3.3 #51)
1)6600,PythonForSeries60_pre_SDK20.SIS (from 1.1.0?), ftplib.py (from 2.2.2), tested 07/2005
2)3230,PythonForSeries60_pre_SDK20.SIS (from 1.1.0?), ftplib.py (from 2.2.2), tested 03/2006
5)3230,PythonForSeries60_pre_SDK20.SIS (from 1.1.0?), ftplib.py (shipped version), tested 03/2006
---
doesn't work here (these are current releases):
*)3230,PythonForSeries60_for_2ndEd_SIS (from Python for 2nd Ed Feature Pack 1), ftplib.py (shipped version)
3)3230,PythonForSeries60_for_2ndEd_SIS (from Python for 2nd Ed Feature Pack 1), ftplib.py (from 2.2.2)
4)3230,PythonForSeries60_1stEd.SIS (from PythonForSeries60_for_1stEd_FP1_SIS), ftplib.py (shipped version)
---
*this made me make this test as it is the platform that i am currently using
"""
print "Testing FTP"
import ftplib
from ftplib import FTP
ftp=FTP("ftp.scene.org","anonymous","test")
ftp.retrlines('LIST')
ftp.quit()
print "FTP okay!"
[/code]
Could people please test it on their phones and post to this thread if they can
a) reach the "FTP okay!" message
b) get stuck on the last lines of the retrlines output ("[..]welcome.msg")
Unfortunately I cannot just revert back to the old Python version as the rest of the code requires the newer version.
Any ideas?
Leif
Re: File transfer to remote server. No Bluetooth.
How about the new 1.3.1 from SourceForge? Does your code work with that?
Re: File transfer to remote server. No Bluetooth.
I found a very simple way to transfer text files to a remote server using the excellent simple tutorial of Jurgen Scheible at the address:
[URL=http://www.mobilenin.com/pys60/ex_upload_file_to_url.htm]ex_upload_file_to_url.htm[/URL].
It is enough to have a php on the server and your code have to pass the file as a POST object to the script. It works like a charm!
Mauro
Re: File transfer to remote server. No Bluetooth.
@jplauril: it works with the sourceforge version 1.3.1. just tested it on the weekend. thank you. i also found out that the 1.2.final did not crash but waited about 6 minutes before returning from ftp.retrlines('LIST').
will also try the http post. thanks.