Dropbox is a mod_python program for transmitting large files without email. It lets you upload files to it and send a link for someone else to download it. But instead of having to pass around a long unwieldy URL which gets broken by email clients, it uses a small 16 characters-long string to represent the file.
It works with tokens, which are 16 characters-long random strings. When a new file is uploaded, a token is assigned. Internally, a directory is created to hold the file, and information about the token is stored in a separate file.
New tokens (allowing the upload of a new file) are only allowed by the administrator.
As a normal dropbox user can't just add new files, if you want to use dropbox for a new file transmission to someone else, you must first ask the admin (replaceZ with 12) to create a new token for it.
The admin creates it, and sends you back 2 tokens: one for upload and one for download. Those tokens are simply case-sensitive strings of 24 and 16 characters, respectively. On the dropbox main page, copy-paste the upload token to Token: field in the Upload file for token section. Then click Browse... and locate on your computer the file you wish to upload. Note that the admin will have set, when creating the token, a maximum file size as well as a maximum delay (after which the token is destroyed), so if you waited too long or if your file is too large, DropBox will refuse it.
Next, optionally, enter a short comment about the uploaded file. This comment will be displayed on the download page. Then click Upload file. The file will be uploaded - which may take several minutes - and you will then be presented with the url that can be used to download the file.
A direct link for upload could have been given to you instead of just the token. It will have the form http://wwd.ca/dropbox/up?token=TOKENVALUE. Using this link will bring you to an upload page where the copy-pasting of the token isn't necessary as it was given with the request. Just browse for the file, enter a comment, and click upload.
Once the file is uploaded, DropBox will give you a direct link for download. You can send the token string itself or this full direct link to the recipient of the file, who should follow the instructions below. DropBox also shows you the file size and the MD5 checksum for the file. Please verify those to make sure the file has uploaded correctly. The md5sum can be checked in linux with the command
Note that once you uploaded the file, you can't upload it again, or remove it. This is so that if you spread the token to multiple people who should be getting the file, one of them can't upload a new file immediately and make it look like it was yours.back to top
If you were given only a token (this should be the download token, 16 characters-long, but download will work just as well if you use the upload token, which is 24 characters-long but shares the first 16 characters with the download token), go to the dropbox main page. Copy-paste the token in the Token: field of the Download by token section, and click go to token download page. A new page will allow you to download the file.
If you were given the direct link to the file, just follow the link in your browser. The file will begin to download or you will be presented with a clickable link to the file, along with information on the file.
You can therefore use curl or wget or any other downloader to fetch this file, using the direct link. Note that if you were only given the token itself, the download page shown after having entered the token on the main page will have direct links: you can therefore enter your token then copy the direct link and use them for wget-ing the file. If you don't understand a word of this last paragraph, just ignore it.back to top
An admin is presented with a slightly different main page: a link to an administrative page is added. Clicking on it brings him to the Admin Options section
By clicking the Create a new token button in the Create new token section, a new token will be created, with no file uploaded. Send this token (or the direct links) to the user who wishes to upload a file. He should then follow the instructions above. Optionally, up to 12 tokens can be created at once by adjusting the number of tokens selector before clicking the button.
The admin section also has the file browser and comment entry areas for uploading a new file directly. The token will be created automatically, and links will be given to the new file.
In both cases, set the file options before clicking on Submit. A maximum delay sets time that the token will last. After this time has elapsed (from the time of the creation of the token), the uploading of the file will be impossible, and the token and its associated files will be destroyed automatically. The token is then permanently retired: it will never be re-used again. Also set the maximum size, in MB, of the token upload. In the case of a direct file upload (new file is uploaded directly from the main page, creating a new token), there is no need to set this maximum size.back to top
Additionally, the administrator has a Token Manipulation section. Since that page is unreachable for normal users, i made a screenshot you can look at. (if you're wondering why the files are bigger than their maxsize, it's because the files were copied locally through the command-line in those 2 cases, instead of through the upload page which checks the size; also: screenshot might not have been updated with latest features described below)
All tokens are listed there, with their status and information:
Below the table, a form allows the modification of the tokens. First, select the tokens you want to act on by clicking their checkboxes. Then:
DropBox was written from scratch by Éric St-Jean, dropboxZ@e.wwd.ca (replaceZ with 12), and is therefore my copyright. I will GPL it at some point, but i first need to audit the code to make sure releasing it won't let you find giant holes and sabotage my server...
If you're interested, though, email me(replaceZ with 12) to tell me - i'll just assume nobody gives a hoot for now.
It was written using mod_python, which i totally love, much more than php which i had been using in the past (note that by itself, mod_python is not a templating mecanism: you can't just insert python snippets in your html; python templating has been done by others, however, such as WebWare - i'm just not that warm to the idea of putting code in html - i prefer the other way around). Mod_python of course uses python, the best programming language in the whole world. Well, better than whatever else i pretend to know (c,c++,java,bash), which isn't that much to say, having left out the interesting ones like scheme. And of course, you don't program a device driver in python. But for everything else, there's mastercard. I mean, python. yes.
And DropBox runs on the Apache webserver, on a Debian GNU/Linux server. It should run on any mod_python+Apache-supported machine, though i coded things like paths assuming i was on Unix/Linux iron, so DropBox will need some mods to run on OS9 or Windows.back to top
Help $Revision: 1.6 $ $Date: 2004/02/11 06:34:52 $DropBox $Revision: 1.13 $ $Date: 2004/07/24 15:23:04 $
|Powered by DropBox using mod_python on Apache on Debian.|