Announcement

Collapse
No announcement yet.

Tricky download script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Tricky download script

    I'm trying to get the data from http://data.nwac.us/OSOMTB but what happens is that there's a 302 redirect to an automatic download page, so for example on my local computer, the data is saved as a file. Used to be that data was displayed as raw text so it was easy to mvcall it.

    I've tried every way I can think of (many convolutions on mvcall and for kicks wget) to access this redirect / download from inside a mivascript without success. This is for a personal site where I turn that data into real time charts and stuff for skiers.

    Any ideas? I'm wondering if there's something I can do with the headers in mvcall, but no real examples to go by in the docs.

    Thanks,

    Scot
    M.A.D.* since 1997

    http://www.scotsscripts.com

    *miva application developers

    #2
    Re: Tricky download script

    Figured out a workaround- used a php curl script to output the redirect/download and picked that up using mvcall

    Still wonder if there's a way to do it purely using mivascript.
    M.A.D.* since 1997

    http://www.scotsscripts.com

    *miva application developers

    Comment


      #3
      Re: Tricky download script

      Did you try to read the 302 using variables such as s.callreturnheader1 within the MvCALL? If you can do that, I'd think you could execute a second MvCALL to the real URL. Haven't tried it myself, though.
      Kent Multer
      Magic Metal Productions
      http://TheMagicM.com
      * Web developer/designer
      * E-commerce and Miva
      * Author, The Official Miva Web Scripting Book -- available on-line:
      http://www.amazon.com/exec/obidos/IS...icmetalproducA

      Comment


        #4
        Re: Tricky download script

        I did try that. I was using miva_variable_value and rolling through them without any results. I just checked it by calling it literally- s.callreturnheader1, 2, 3, etc.. which shows some more headers including the destination URL. I'll put this in the script notes for next season when I update it again. Thanks for the tip.
        M.A.D.* since 1997

        http://www.scotsscripts.com

        *miva application developers

        Comment

        Working...
        X