in reply to Win32::IE::Mechanize download file

It sounds like target web page has some Javascript which redirect you. You need some tools to find what's happens. Try to use LiveHTTPHeaders extension of Firefox to look into HTTP headers.

After that you can just use redirection URL in your script.

Replies are listed 'Best First'.
Re^2: Win32::IE::Mechanize download file
by imrags (Monk) on Jul 28, 2008 at 12:56 UTC
    a part of the html code which i think is relevant...

    <form name="subscriber.export" method="post" action="/something/someth +ing/pidXMxhf8BvVhiTih9LIxLqC-s81"> <input type="hidden" name="activepage" value="subscriber.export"> <input type="hidden" name="pageName" value="subscriber.export"> <input type="hidden" name="uid" value="11021864546"> <input type="hidden" name="filename" value="NXwC0VHkO3tkyOfknRf0vu +xuOCPnbFTeIQ**"> <input type="hidden" name="filetype" value="csv">

    this is the html code... and this is the submit button code...

    <tr> <td><br><input type="submit" value="Download Export File" name="action +_download" id="download" class="btn-primary"></td> </tr>

    Hope this is of some use...

    20080728 Janitored by Corion: Put HTML in code tags, as per Writeup Formatting Tips

      Ok reformatted:

      LOCATION::

      http://website_name/export/download.jsp?t=csv&f=/ccexport/fs076/se1102186454649.csv

      Request headers:
      Host: website_name.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1 +6) Gecko/20080702 Firefox/2.0.0.16 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9 +,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://website_name.com/rnavmap/evaluate.rnav/pidEjc9NdNrtXuC +EdiuJgbZpwf57?activepage=subscriber.activity&action=export&uid=110218 +6454649 Cookie: mbox=PC#1217149956640-344459.05#1280338508|geo#1#1280338508|se +ssion#1217266506140-54222#1217268367|check#true#1217266567|edge#app6- +prod5.prod5.offermatica.com.1217266473358#1217266508; sops=1101500533 +487#1=O#2=A#3=O#4=A#; s_vi=[CS]v1|488C3C0400004D96-A3A096600000468[CE +]; __utmz=152702054.1217149964.1.1.utmccn=(direct)|utmcsr=(direct)|ut +mcmd=(none); cclp_split=sc_01_ts=4501752|sc_01=200806_Award::Recipe B +: You|; cclp_content=lp_uid=20080727_05:12:25.279_8EwuoNSSUMx28IshuRq +sBsz_P1-WS031|; cclp_partner=prt_02_ts=4501918|prt_05_ts=4503694|prt_ +01_ts=4501752|prt_04_ts=4503366|prt_05=partner.name::ROVING|prt_04=pa +rtner.name::ROVING|prt_03_ts=4502980|prt_03=partner.name::ROVING|prt_ +02=partner.name::ROVING|prt_01=partner.name::ROVING|; cclp_referral=p +artner=ROVING|pn=ROVING|sitereferrer=http://website_name.com/login.js +p|partner.name=ROVING|; __utma=152702054.1731584802.1217149964.121724 +6826.1217266509.5; JSESSIONID=0000Ejc9NdNrtXuCEdiuJgbZpwf:-1; BIGipSe +rverProdUI=1227166730.20480.000; BIGipServerProdUICC=1227166730.20480 +.000; BIGipServerProdAOLUI=1227166730.20480.000; BIGipServerProdAOLSS +=1227166730.20480.000; BIGipServerProdUIEA=1227166730.20480.000; pid= +-1; __utmc=152702054; s_cc=true; s_sq=%5B%5BB%5D%5D