Results 1 to 12 of 12

Thread: help for url

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    8

    Exclamation help for url

    hi everyone,

    i can download simple files like "www.freevbcodes\networking\e-mail.com"

    but cant download from download.com site may be for its link is not valid for my

    download manager.

    i put my code below
    Code:
    Public Function StartUpdate(strURL As String)
    BytesAlreadySent = 1
    If strURL = "" Then
    'MsgBox "Enter the URL.", vbExclamation
    Else
    
    Image5.Visible = False
    Image1.Visible = True
    End If
    URL = strURL
    Dim Pos%, LENGTH%, NextPos%, LENGTH2%, POS2%, POS3%
        Pos = InStr(strURL, "://") 'Record position of ://
        LENGTH2 = Len("://") 'Record the length of it
        LENGTH = Len(strURL) 'Length of the entire url
            If InStr(strURL, "://") Then  ' check if they entered the http:// or ftp://
            strURL = Right(strURL, LENGTH - LENGTH2 - Pos + 1) ' remove http:// or ftp://
            End If
            'If InStr(strURL, "\") Then
            'MsgBox "Invalid URL(\)."
            'End If
            
                If InStr(strURL, "/") Then 'looks for the first / mark going from left to right
                POS2 = InStr(strURL, "/") 'gets the position of the / mark
    '-----------------GET THE FILENAME-------------
                Dim StrFile$: StrFile = strURL 'load the variables into each other
                Do Until InStr(StrFile, "/") = 0 'Do the loop until all is left is the filename
                LENGTH2 = Len(StrFile) 'get the length of the filename every time its passed over by the loop
                POS3 = InStr(StrFile, "/") 'find the / mark
                StrFile = Right(strURL, LENGTH2 - POS3) 'slash it down removing everything before the / mark including the / mark...
                Loop
                FileName = StrFile
    '----------------END GET FILE NAME--------------
                strSvrURL = Left(strURL, POS2 - 1) 'removes everything after the / mark leaving just the server name as the end result
                End If
    '-----------END TRIM THE URL FOR THE SERVER NAME-----------
    
    End Function
    Public Function Download()
    StartUpdate Text1
    
    End Function
    pls help me

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: help for url

    What does the error message say when you try?

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    8

    Re: help for url

    when i copy paste link it will save the link with below:
    "G:\dmanager\redir?edId=3&siteId=4&oId=3000-2239_4-10019223&ontId=2239_4&spi=de9f30ac317baa60c601e68a53ef5de4&lop=link&ltype=dl_dlnow&pid=10841442&mfgI d=85737&merId=85737&destUrl=http%3A%2F%2Fwww.download.com%2F3001-2239_4-10841442.html%3Fspi%3Dde9f30ac317baa60c601e68a53ef5de4"

    this is some coding part Where error raise, it'll raise in first line with bold:
    Code:
    Open FilePathName For Binary Access Write As #1 'opens file for output
            Put #1, BytesAlreadySent, DATA 'writes data to the end of file
            BytesAlreadySent = Seek(1)
            Close #1
    thanks

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    8

    Re: help for url

    it is say that "File not found" & error number is "53".

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: help for url

    "G:\dmanager\redir?edId=3&siteId=4&oId=3000-2239_4-10019223&ontId=2239_4&spi=de9f30ac317baa60c601e68a53ef5de4&lop=link&ltype=dl_dlnow&pid=10841442&mfgI d=85737&merId=85737&destUrl=http%3A%2F%2Fwww.download.com%2F3001-2239_4-10841442.html%3Fspi%3Dde9f30ac317baa60c601e68a53ef5de4"

    Isn't really a valid filename.

    What is G:\dmanager\redir supposed to be? Is that your application or the URL you're entering into the textbox to initiate the download?

  6. #6

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    8

    Re: help for url

    "G:\dmanager\redir" this is the path to save downloaded file in direcotry.
    end the other part is link that i copy pasted in download manager from download.com
    i cant send my project because its larger than that this forum supports.
    i send u code before,in that bold line is getting error, says that bad file name.
    so what should i do?
    thanks for ur reply.

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: help for url

    You don't have to attach the entire project, just the piece of code giving you problems.

  8. #8

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    8

    Re: help for url

    how can i download softwares from download.com?
    tell me the procedure to download files?

    thanks

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: help for url

    download.com uses an IFRAME on the page to initiate the download. This means that when you are given the 'download' URL, you need to find the IFRAME in it and get the src attribute out. An example is:

    Code:
    http://software-files.download.com/sd/12_5iSjqH-7ZrQvuBepO14of8uJQJWd_ARROeJGc2oEBjrehon8f-fHR2o0Df8jnZJ2zdUEOBJv9qicu6QTDEay4kq2BC-L1/software/10852236/10004813/3/snagit.exe?lop=&ptype=1721&ontid=2192&siteId=4&edId=3&spi=fdaf0f079e4f59dc23d847045bf6a4a3&pid=10852236&psid=10004813

  10. #10

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    8

    Re: help for url

    how can i do it?

  11. #11
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: help for url

    HttpRequest the page. Get the page, then parse it. How familiar are you with string parsing and do you have the HTML of the target page already?

  12. #12

    Thread Starter
    New Member
    Join Date
    May 2008
    Posts
    8

    Re: help for url

    i dont know about string parsing. will u please explain me.

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