473,387 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Downloading file without knowing the corrent filename

On the following page is for Symantec Antivirus updates:

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

Todays virus definition filename & path is:

http://definitions.symantec.com/defs...28-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
Nov 21 '05 #1
3 1225
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
Nov 21 '05 #2
http://definitions.symantec.com/defs...28-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?

Nov 21 '05 #3
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) ...

-----------------------------------------------------

I will build the program & then it will run around 11pm GMT. The filename
will be created at runtime & automatically download the file

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Keith Dewell | last post by:
Greetings! My current job has brought me back to working in C++ which I haven't used since school days. The solution to my problem may be trivial but I have struggled with it for the last two...
11
by: BoonHead, The Lost Philosopher | last post by:
I think the .NET framework is great! It's nice, clean and logical; in contradiction to the old Microsoft. It only saddens me that the new Microsoft still doesn't under stand there own...
1
by: Avin Patel | last post by:
Hi, I am looking for script to allow multiple files can be uploaded/attached in webform ( mostly cgi/perl or php). But I don't like the multiple input boxes using "<input type="file" size="40"...
5
by: kevin | last post by:
Hi, Any help with this would be really appreciated! I'm trying to download a file from a remote server. The access permissions is okay but the problem I'm facing is that the file is getting...
6
by: Tony K | last post by:
I have the most peculiar problem with an ASP.NET page which we use for downloading a file. When the user clicks on a link, the link points to an ASPX page which downloads the file selected. ...
0
by: TJ | last post by:
Hi, I've written code web-based uploading and downloading. Here is some code for it. For saving file into MS-SQL database, SaveFileIntoDB(HttpPostedFile file) { int fileLength =...
2
by: Bala | last post by:
Hi I am trying to download the PDF files from my webserver using ASP.Net. All my files are stored at F Drive on webserver. Like this F:\Main Folder\Sub Folder\Files\File1.pdf I am...
3
by: Chuck Renner | last post by:
Please help! This MIGHT even be a bug in PHP! I'll provide version numbers and site specific information (browser, OS, and kernel versions) if others cannot reproduce this problem. I'm...
1
by: shahidrasul | last post by:
i want to download a file which user select from gridview, downloading is completing without problem but after download i want to refresh my page because i do some changes in db . but when...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.