1,731 bytes added
, 15:36, 12 January 2010
This is a simple python script that allows the file share activity to save files on the jabber server.
This optional server is for the [[FileShare]] Activity.
==Code==
The code can be found in the FileShare Activity's [http://gitorious.org/jlew/xo-file-distro/trees/master/FileShare.server git repo]
==Future Plans==
* Allow users to have private upload/download files.
** Would allow user to upload file to a private folder for them/admins to access (example, student turning in an assignment)
==Network Policy==
This is the network policy in place by the FileShare system.
===Connecting===
All clients must check version and announce themselves if they with to have more then download rights
# When the client first connects it sends a GET request to '''/version'''.
#* Version must return the protocol version. The current version is 2.
# Then if the version is 2 or greater, it makes a POST request to '''/announce_user'''
#* Announce user expects ''id'' and ''nick'
#* This tells the server about the user list.
#* Returns the permission string (0 download only, 1 add/remove, 2 administer)
===Downloading===
# Any user can GET request '''/fileList'''.
#* File list returns a JSON object in the format the xo is expecting.
# To download a file a GET request of the file id will return the file.
===Uploading/Removing===
# To upload a file, just POST the file to '''/upload'''.
#* Expects ''id'', ''jdata'', and ''file''
# To remove a file, POST file id to '''/remove'''
#* Expects ''id'' and ''fid''
===Administer Users===
# Admin can request user list by POST to '''/user_list'''.
#* Expects id (must have admin permission)
# Modify User level by POST to '''/user_mod'''.
#* Expects ''id'', ''userId'', and ''level''.