Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[ASP]Prüfen ob URL existiert

Empfohlene Antworten

Grüße euch!

Ich stehe vor dem Problem mit ASP überprüfen zu müssen, ob eine bestimmte URL eines Bildes existiert oder nicht. Leider hab ich im Forum hier oder in anderen Foren nichts darüber gefunden, nur wie man das in PHP macht. Kann mir hier einer Tips geben, wie man das am besten mit ASP realisiert?

Also was du probieren kannst ist folgendes (hab aber keine Ahnung obs nicht vieleicht was eleganteres gibt)

On Error Resume Next

Set objHttp = Server.CreateObject("MSXML2.ServerXMLHttp")

objHttp.SetTimeouts 6000, 6000, 6000, 6000

'--- Create request: Method, URL, Async

objHttp.open "GET", strURL, false

'--- Send request

objHttp.send

'--- using a stream to get the correct charset

Set objStream = Server.CreateObject("ADODB.Stream")

objStream.Open

objStream.Type = adTypeText

objStream.WriteText (objHttp.responseBody)

objStream.Position = 0

objStream.Charset = "latin1"

GrabFile = objStream.ReadText(adReadAll)

objStream.close

'--- terminate connection

Set objStream = nothing

Set objHttp = nothing

wobei strUrl deine zu überprüfende Datei ist. Wenns die Datei gibt sollte anschließend was im Stream drin sein. Evtl. musst du noch objStream.ReadText(adReadAll) anpassen. Im Moment werden da ja alle Zeichen von der URL gelesen (Bilder können da ja recht groß werden)...

Danke für die Hilfe, aber ich hab eine kürzere Lösung gefunden:

Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")

objHTTP.open "GET", strBild, False

objHTTP.send

sHTML=objHTTP.statusText

if err or sHTML<>"OK" then

keinBild=true

else

keinBild=false

end if

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.