473,386 Members | 1,827 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,386 software developers and data experts.

how to check online image date

I am using the following code to see if the image is there, is there a way
to check the image date as well?

Dim sTxt As String
If strURL <> "" Then
If Left(LCase(strURL), 7) <> "http://" Then
strURL = "http://" & strURL
End If
On Error Resume Next
Dim objHTTP
Dim sHTML
objHTTP = CreateObject("Microsoft.XMLHTTP")

objHTTP.open("GET", strURL, False)
objHTTP.send()
sHTML = objHTTP.statusText
If sHTML <> "OK" Then
sTxt = "fail"
Else
sTxt = "ok"
End If
objHTTP = Nothing
Else
sTxt = "fail"
End If

Dim httpRequest As HttpRequest = HttpContext.Current.Request
Dim strFrom = httpRequest.ServerVariables
Dim p As Integer
p = InStr(1, strFrom, "?")
If p > 0 Then
strFrom = Left(strFrom, p - 1)
End If
If sTxt = "fail" Then
errLog = errLog + "ID=" & ID & "********URL=" & strURL & Chr(13)
& Chr(10)
setActive1(ID, "N")
Else
setActive(ID, "Y")
End If
--
David Fetrow
Helixpoint LLC.
http://www.helixpoint.com
da***@helixpoint.com
Nov 18 '05 #1
2 1784
a GET actually retrieves the image (look at the headers for date info). use
a HEAD request to just get date and size info.

-- bruce (sqlwork.com)

"DaveF" <df*****@geodecisions.com> wrote in message
news:OW**************@tk2msftngp13.phx.gbl...
I am using the following code to see if the image is there, is there a way
to check the image date as well?

Dim sTxt As String
If strURL <> "" Then
If Left(LCase(strURL), 7) <> "http://" Then
strURL = "http://" & strURL
End If
On Error Resume Next
Dim objHTTP
Dim sHTML
objHTTP = CreateObject("Microsoft.XMLHTTP")

objHTTP.open("GET", strURL, False)
objHTTP.send()
sHTML = objHTTP.statusText
If sHTML <> "OK" Then
sTxt = "fail"
Else
sTxt = "ok"
End If
objHTTP = Nothing
Else
sTxt = "fail"
End If

Dim httpRequest As HttpRequest = HttpContext.Current.Request
Dim strFrom = httpRequest.ServerVariables
Dim p As Integer
p = InStr(1, strFrom, "?")
If p > 0 Then
strFrom = Left(strFrom, p - 1)
End If
If sTxt = "fail" Then
errLog = errLog + "ID=" & ID & "********URL=" & strURL & Chr(13) & Chr(10)
setActive1(ID, "N")
Else
setActive(ID, "Y")
End If
--
David Fetrow
Helixpoint LLC.
http://www.helixpoint.com
da***@helixpoint.com

Nov 18 '05 #2
If you want to check if a file you're downloading has changed, you could make
use of the If-Modified-Since header, as described in HTTP.

The Web Server should recognize that header, and only send the file back if
it was modified after your specified date.
Nov 18 '05 #3

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

Similar topics

20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
4
by: Gianpiero Colagiacomo | last post by:
Hi, I'm trying to use the following code (found online - can't remember where) to validate images being uploaded to my server: function checkImageUpload (fileName) { if (document.layers &&...
2
by: Tjerk | last post by:
Hello all, I have the script below to change an image depending on the date upto january it worked fine but then it just stopped working does anybody have an idea how I can make it work again or...
1
by: Christos Kalantzis | last post by:
Hello, DB2 7.2 on AIX. I take online backups EVERY night and rsync my log folder every hour after running the DB2 ARCHIVE LOG command to make sure I dump the log buffer to a log file. Now...
4
by: VR | last post by:
I am trying to embed a check box into a FlexGrid's cell, but having a problem when I start scrolling the grid. Here is my MyCheckBox class... class MyCheckBox : CheckBox { void Init (...
5
by: zimmy | last post by:
Hi, Is it possible to check whether ASP.NET is installed on a machine, within a program that I'm writing in C#? And if it's installed, can I check if it is enabled? How? Thanks
3
by: TK | last post by:
Excuse me for multiple posting because I've posted this message to aspnet.security NG but have not got any response yet. I'm building an ASP.NET application works in Forms Authentication mode...
6
by: Raj | last post by:
How can we do an online restore of a tablespace using the incremental backup's? we are on a partitioned database... Also, how could we use backup copy made by the load (using the copy to option...
10
by: Konstantin Andreev | last post by:
Hello. Some time ago I asked in this conference, - How to use an ONLINE BACKUP to restore database onto another system? - but got no answers. Therefore I can conclude it is not possible. But......
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.