Downloading file without knowing the corrent filename

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On the following page is for Symantec Antivirus updates:

http://www.sarc.com/avcenter/download/pages/US-SAVCE.html

Todays virus definition filename & path is:

http://definitions.symantec.com/defs/20050228-024-x86.exe

Notice the filename is: 20050228-024-x86.exe

I can get the '20050228-' & '-x86.exe', but there is no way of telling what
the 3 numbers will be. One day they could be 006 (like yesterday) & another
day they could be 024 (like today).

I have a download file routine which works fine if you pass it a 100%
perfect link, but if you don't it errors. Here's my test function:

Private Function CreateFilename(ByVal iRevision As Integer) As String
Dim strRevision As String = String.Format("{0:d3}", iRevision)
Dim strPath As String = "http://definitions.symantec.com/defs/"
Dim strFileEnding As String = "-x86.exe"
Dim strDate As String = Format(DateTime.Today, "yyyy/MM/dd-")
Return strPath & strDate & strRevision & strFileEnding
End Function

If I call this fuction 'CreateFilename(24)' then the link is correct, but
displays an Object not set for an instance of an object error.

If I say:

Dim AAA As String =
"http://definitions.symantec.com/defs/20050228-024-x86.exe" then there is no
error although the two are identical.

Anyway, I need a way to find the correct reference number. Example 024.

Do I download the html for the page & search for 'http' or 'x86' for example
& find it that way or do I create an array of filenames & try each one until
they work?

Any help would be grateful
 
Crouchie,

I assume it is the daily build, however why don't you ask them that
yourself?

And when it is that build, it can be hard to get it with not only testing if
it exist using the http.request

Just my thought,

Cor
 
http://definitions.symantec.com/defs/20050228-024-x86.exe

Notice the filename is: 20050228-024-x86.exe

I have a download file routine which works fine if you pass it a 100%
perfect link, but if you don't it errors. Here's my test function:

Private Function CreateFilename(ByVal iRevision As Integer) As String
Dim strRevision As String = String.Format("{0:d3}", iRevision)
Dim strPath As String = "http://definitions.symantec.com/defs/"
Dim strFileEnding As String = "-x86.exe"
Dim strDate As String = Format(DateTime.Today, "yyyy/MM/dd-")
Return strPath & strDate & strRevision & strFileEnding
End Function

If I call this fuction 'CreateFilename(24)' then the link is correct, but
displays an Object not set for an instance of an object error.

If I say:

Dim AAA As String =
"http://definitions.symantec.com/defs/20050228-024-x86.exe" then there is no
error although the two are identical.

You say that the two are identical but they appear not to be. Your
format statement is formatting the date as yyyy/MM/dd- with slashes
but the filename does not have slashed in the date?
 
Yeah, sorry. That date shouldn't have had the '-' there. The amount of times
I've changed the function...

Anyway, when I use a variable for example to hole the filename:

Example:

Dim strFile As String = CreateFilename(24) ...
 
Am 26.03.2010 15:47, schrieb arjun koirala:
downloading file without knowing

[...]

Congratulations! Answering the oldest post ever. You saw it's from 2005?
 
Back
Top