Hello, I want to upload a file from my computer to a filehoster like hotfile.com via a python script. Because Hotfile is only offering a webbased-upload service (no ftp) I need python first to login with my username and password and after that to upload the file. When the Filetransfer is over, I need the Download and Delete-link (which is generated right after the Upload has finished). Is this even possible? If so, can anybody tell me how the script looks like or even give my hints how to build it? Thanks
For a similar task, I've previously used mechanize, with some quite success.
Note: although I was not uploading files, its documentation says that it is capable to handle also file uploads.
You mention they do not offer FTP, but I went to their site and found the following:
How to upload with FTP? ftp.hotfile.com user: your hotfile username pass: your hotfile password You can upload and make folders, but cant rename,move files
Try it. If it works, using FTP from within Python will be a very simple task.
Okay, you want to use Python to upload a file using HTTP "put". You will need to use a Python library that lets you do HTML stuff; a good choice might be httplib which is included with Python.
A Google search for "Python HTTP put" found me this:
http://inamidst.com/proj/put/put.py
This appears to be complete working code that solves your problem.