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 7601293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:07:56+00:00 2026-05-30T23:07:56+00:00

I want to use Ruby Mechanize to write an auto file uploading script for

  • 0

I want to use Ruby Mechanize to write an auto file uploading script for a website. But the read upload step of the website is done by a Flash file. I use fiddler captured the traffic from the Flash file to the server. Here is it.

POST /upload.php HTTP/1.1
Accept: text/*
Content-Type: multipart/form-data; boundary=----------KM7KM7Ij5KM7KM7ei4GI3GI3gL6GI3
User-Agent: Shockwave Flash
Host: 119.147.15.17<this is fake IP address>
Content-Length: 7800236
Connection: Keep-Alive
Pragma: no-cache

------------KM7KM7Ij5KM7KM7ei4GI3GI3gL6GI3
Content-Disposition: form-data; name="Filename"

learning_objectives.flv
------------KM7KM7Ij5KM7KM7ei4GI3GI3gL6GI3
Content-Disposition: form-data; name="FileData"; filename="learning_objectives.flv"
Content-Type: application/octet-stream

This_is_the_real_data_in_learning_objectives.flv

My question is how can I simulate this post requrest? Currently what I can think of is create a form by myself and add an input element with type file. Then submit this form with customized headers (such as the user-agent etc.). But I’m still have difficult in dealing with the file upload part. Anyone can help me with it? Thanks!

  • 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-30T23:07:58+00:00Added an answer on May 30, 2026 at 11:07 pm

    It should look something like this:

    agent.post url, 'FileData' => File.new('learning_objectives.flv')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a web application and want to use Ruby. I have
I want to use Ruby/Mikel Mail gem to access pop3, but am stuck finding
I want to use ruby script for installing all the necessary things for a
I want to use the ruby-units with a rails 3 project, but it seems
I want to use modal pop-up windows in our web app in Ruby on
I want to use RSpec mocks to provide canned input to a block. Ruby:
Say I'm writing some ruby code and I want to use the standard Date
I have an underlying ruby game-engine code and I want to use the web
it's about Ruby On Rails. I want to use Googleauth and need to add
i want use some data from a website with web service. i have a

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.