views:

24

answers:

1

hi friends,

i have desktop interface in python which uses drag and drop and where users can login. right now if i drop a file it will be stored in local directory. now what i want is, i want to upload user dropeed file to remote web server. can anybody help me in direction ? i have been exploring python's ftp library's and everything i can find. anybody suggest me some good option to do the same ?

i also need to track user who uploaded file so if you can help me figuring out best option then it will be great help. tell me best way to achieve this. i am not sure ftp is the only option i have or not.

and thanks for reading this much. have a good day.

A: 

In order to avoid reinventing the wheel, I recommend using FTP. With that being said, you'll need, of course, to have an FTP server.

By using FTP, this entirely avoids the creation of a proprietary file transferring server and client system. That would entail massive amounts of coding of socketsperhaps even the confusing and convoluted use of Asynchronous Socketing if you plan on allowing more than one user to connect at a time – a user database, etc.

As you are already aware, python is compatible with FTP servers. More information is available from the online Python Documentation.

As for the tracking of which user uploads which file, I'd recommend creating a file with some sort of prefix. For example, if you have the user-uploaded file names.txt, make python upload a sister file _names.txt inside which will be the name of the user who uploaded the file.
(Have python hide these files in the GUI so that they're abstracted from the end user.)

There are loads more options available, like creating an XML file in each working directory that will serve as the database for each file and user pair in the directory. The creation of an SQLite database is also an option.

Sean
well architecture of my application is bit complex. at first it involves local system then local server in second layer and then remote server. what happens is when user saves file then first it will be checked if local server is available or not if it's not available then it will be stored locally then when it get's back it will be sent to local server. and local server will upload this files to web server. and user's have to login to the system first to upload files. so i was thinking if there's a way to check which user uploaded file to local file server using python application.
hardik