Results 1 to 3 of 3

Thread: How to get Download File name

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013

    How to get Download File name

    Hello All Members
    My download link this

    i find download link
    how can posibal

  2. #2
    Join Date
    Feb 2012
    West Virginia

    Re: How to get Download File name

    What is that link to? and what do you mean about getting the file name? What are you using to download with?

  3. #3
    Frenzied Member
    Join Date
    Feb 2015

    Re: How to get Download File name

    Hello kako0000000.
    Option Explicit
    Private Sub Form_Load()
        Dim objHTTP     As Object
        Dim fNum        As Integer
        Dim Resp        As String
        Dim filename    As String
        Dim index       As Long
        Set objHTTP = CreateObject("MSXML2.XMLHTTP")
        Call objHTTP.Open("GET", "", False)
        Resp = objHTTP.getResponseHeader("Content-disposition")
        index = InStr(1, Resp, "filename=") + 10
        filename = Mid$(Resp, index, Len(Resp) - index)
        MsgBox filename
        ' Save the file into disk
        fNum = FreeFile
        Open "C:\" & filename For Binary As fNum
        Put fNum, , objHTTP.responseBody
        Close fNum
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width