2

I want to upload a file from my computer to a file hoster like hotfile.com via a Python script. Because Hotfile is only offering a web-based upload service (no ftp).

I need Python first to login with my username and password and after that to upload the file. When the file transfer 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

3 Answers 3

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

0

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.

1 Comment

There is one thing I hate about FTP: it transmits your login credentials unencrypted over the Internet. If the HTTP solution uses SSL encryption, that is very much preferable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.