AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

WebDav - NextCloud

Ein Thema von Pfaffe · begonnen am 31. Jan 2022 · letzter Beitrag vom 4. Feb 2022
Antwort Antwort
Carsten Hölscher

Registriert seit: 29. Jul 2008
77 Beiträge
 
Delphi 11 Alexandria
 
#1

AW: WebDav - NextCloud

  Alt 1. Feb 2022, 16:55
Wichtig ist ein aktuelles Indy gewesen. Das musste ich erstmal aktualisieren.
Und dann muss natürlich die Verschlüsselung zum System passen. Ich kann mal ein paar Code-Schnipsel raussuchen.

Carsten
  Mit Zitat antworten Zitat
Carsten Hölscher

Registriert seit: 29. Jul 2008
77 Beiträge
 
Delphi 11 Alexandria
 
#2

AW: WebDav - NextCloud

  Alt 3. Feb 2022, 18:01
Hier mal der Inhalt der dfm-Datei und 2 Beispiele wie ich eine Datei und eine Auflsitung des Serverinhalts mache:

Code:
  object IdConnectionIntercept: TIdConnectionIntercept
    Left = 512
    Top = 64
  end

  object IdSSLIOHandlerSocketOpenSSL: TIdSSLIOHandlerSocketOpenSSL
    Intercept = IdConnectionIntercept
    MaxLineAction = maException
    Port = 0
    DefaultPort = 0
    SSLOptions.Method = sslvTLSv1_2
    SSLOptions.SSLVersions = [sslvTLSv1_2]
    SSLOptions.Mode = sslmUnassigned
    SSLOptions.VerifyMode = []
    SSLOptions.VerifyDepth = 0
    Left = 456
    Top = 48
  end

  object IdWebDAV: TIdWebDAV
    Intercept = IdConnectionIntercept
    IOHandler = IdSSLIOHandlerSocketOpenSSL
    OnWork = IdWebDAVWork
    OnWorkBegin = IdWebDAVWorkBegin
    OnWorkEnd = IdWebDAVWorkEnd
    HandleRedirects = True
    ProxyParams.BasicAuthentication = False
    ProxyParams.ProxyPort = 0
    Request.CacheControl = 'no-cache'
    Request.Connection = 'Keep-Alive'
    Request.ContentEncoding = 'utf-8'
    Request.ContentLength = -1
    Request.ContentRangeEnd = -1
    Request.ContentRangeStart = -1
    Request.ContentRangeInstanceLength = -1
    Request.Accept = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
    Request.AcceptCharSet = 'utf-8'
    Request.BasicAuthentication = True
    Request.UserAgent = 'Mozilla/3.0 (compatible; Indy Library)'
    Request.Ranges.Units = 'bytes'
    Request.Ranges = <>
    HTTPOptions = [hoForceEncodeParams]
    Left = 400
    Top = 32
  end
 
 
  // datei öffnen
  stream:=TMemoryStream.Create;
  ss:=TStringList.Create;

  IdWebDAV.Request.URL:=....;
  IdWebDAV.Request.Username:=....;
  IdWebDAV.Request.Password:=....;
  IdWebDAV.Request.CustomHeaders.Clear;
 
  try
    IdWebDAV.Get(<URL der Datei>, stream);
    stream.Position:=0;
    ss.LoadFromStream(stream);
  except
    on E:Exception do MessageDlg(E.Message + ' ('+<URL der Datei>+')', mtWarning, [mbOK], 0);
  end;
  ss.Free;
  stream.Free;
 
  // dateiverzeichnis abfragen
  WebDAVXml:IXMLDocument ;
  xmlResponse:=TMemoryStream.Create;
  IdWebDAV.DAVPropFind(Serverpfad, nil, xmlResponse, '4', 1, 4); // Die '1' lädt das aktuelle Verzeichnis, die Tiefe kann hier bestimmt werden
  WebDAVXml:=TXmlDocument.Create(nil);
  try
    WebDAVXml.LoadFromStream(xmlResponse);
   ... xml analysieren
  except
    .... //xml-Fehler
  end;  
  xmlResponse.free;
  Mit Zitat antworten Zitat
Pfaffe

Registriert seit: 29. Jan 2009
297 Beiträge
 
Delphi 12 Athens
 
#3

AW: WebDav - NextCloud

  Alt 4. Feb 2022, 12:05
Danke Carsten, hat sofort funktioniert.
  Mit Zitat antworten Zitat
Antwort Antwort

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:18 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz