PDA

Click to See Complete Forum and Search --> : help for url


shivang
Jun 2nd, 2008, 05:24 AM
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

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

Hack
Jun 2nd, 2008, 05:41 AM
What does the error message say when you try?

shivang
Jun 7th, 2008, 11:46 AM
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&mfgId=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:

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

shivang
Jun 7th, 2008, 11:49 AM
it is say that "File not found" & error number is "53".

mendhak
Jun 7th, 2008, 01:15 PM
"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?

shivang
Jun 10th, 2008, 08:25 AM
"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.

Hack
Jun 10th, 2008, 12:05 PM
You don't have to attach the entire project, just the piece of code giving you problems.

shivang
Jun 11th, 2008, 12:44 AM
how can i download softwares from download.com?
tell me the procedure to download files?

thanks

mendhak
Jun 11th, 2008, 04:50 PM
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:

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

shivang
Jul 3rd, 2008, 07:15 AM
how can i do it?

mendhak
Jul 4th, 2008, 02:35 AM
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?

shivang
Jul 4th, 2008, 08:51 AM
i dont know about string parsing. will u please explain me.