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
解决方案
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:
This appears to be complete working code that solves your problem.
本文介绍如何使用Python通过HTTP“PUT”方法将文件从本地计算机上传到如Hotfile.com等文件托管服务。文中提供了使用Python库httplib登录并完成文件上传的具体步骤及样例代码。

被折叠的 条评论
为什么被折叠?



