|
-
Jun 2nd, 2008, 05:24 AM
#1
Thread Starter
New Member
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
-
Jun 2nd, 2008, 05:41 AM
#2
Re: help for url
What does the error message say when you try?
-
Jun 7th, 2008, 11:46 AM
#3
Thread Starter
New Member
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<ype=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
-
Jun 7th, 2008, 11:49 AM
#4
Thread Starter
New Member
Re: help for url
it is say that "File not found" & error number is "53".
-
Jun 7th, 2008, 01:15 PM
#5
Re: help for url
"G:\dmanager\redir?edId=3&siteId=4&oId=3000-2239_4-10019223&ontId=2239_4&spi=de9f30ac317baa60c601e68a53ef5de4&lop=link<ype=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?
-
Jun 10th, 2008, 08:25 AM
#6
Thread Starter
New Member
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.
-
Jun 10th, 2008, 12:05 PM
#7
Re: help for url
You don't have to attach the entire project, just the piece of code giving you problems.
-
Jun 11th, 2008, 12:44 AM
#8
Thread Starter
New Member
Re: help for url
how can i download softwares from download.com?
tell me the procedure to download files?
thanks
-
Jun 11th, 2008, 04:50 PM
#9
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
-
Jul 3rd, 2008, 07:15 AM
#10
Thread Starter
New Member
-
Jul 4th, 2008, 02:35 AM
#11
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?
-
Jul 4th, 2008, 08:51 AM
#12
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|