Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6067253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:35:19+00:00 2026-05-23T09:35:19+00:00

Hello everybody (first post here). I am trying to send data to a webpage.

  • 0

Hello everybody (first post here).

I am trying to send data to a webpage. This webpage request two fields (a file and an e-mail address) if everything is ok the webpage returns a page saying “everything is ok” and sends a file to the provided e-mail address. I execute the code below and I get nothing in my e-mail account.

import urllib, urllib2

params = urllib.urlencode({'uploaded': open('file'),'email': 'user@domain.com'})
req = urllib2.urlopen('http://webpage.com', params)
print req.read()

the print command gives me the code of the home page (I assume instead it should give the code of the “everything is ok” page).

I think (based o google search) the poster module should do the trick but I need to keep dependencies to a minimum, hence I would like a solution using standard libraries (if that is possible).

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:35:19+00:00Added an answer on May 23, 2026 at 9:35 am

    Thanks everybody for your answers. I solve my problem using the mechanize library.

    import mechanize 
    
    br = mechanize.Browser()
    br.open('webpage.com') 
    
    email='user@domain.com'
    
    br.select_form(nr=0) 
    br['email'] = email 
    br.form.add_file(open('filename'), 'mime-type', 'filename')    
    br.form.set_all_readonly(False) 
    br.submit() 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note: This question is posted here hello everybody, I have a predefind list of
Hello everybody let me give you the background first: I'm working on a project
Hello everybody I have this string: [JOLLY BLU at STAY SHIP, Voy: 0275/11] How
My string contain a lot of HTML entities, like this "Hello <everybody> there" And I want
Hello everybody. I would like to know how to download and save a file
Hello everybody I'm trying to replace the 'text' input type to 'password' . And
Hello everybody I've recently asked this question and I've given up with the 'replace
Hello everybody I'm trying to make my own web site with framework JBoss Netty,
So, hello everybody. I've made two test programs for creating a own control. One
Hello Everybody! I got the following error, while trying to test a code for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.