Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
WebDav ile Yandex Diskten Klasör ve Dosya Listesi Alma
#1
Merhaba 
Uzun Zamandır Webdav Protokolu ile Yandex'e Bağlanıp Bilgi Almaya Çalışıyordum
Nihayet Bağlantı Yapabildim Ancak Klasör Bilgilerini Veriyor Dizin adı , oluşturma ve değiştirme tarihi gibi bilgilerini listeliyor
Yandex te
https://tech.yandex.com/disk/doc/dg/refe...t-docpage/
Dizin içeriğini almak için Depth Değerini 1 yazın diyor 
ben Depth: 1 yazdığım halde yine Dizin bilgisini gösteriyor


Yandex Bağlantı Kodum

		  /*
                  Edit1->Text = "https://webdav.yandex.com.tr";
                  Edit2->Text = "yandex_kullanici_ad";
                  Edit2->Text = "yandex_sifre";
                  */
                	String    Jeton;
	TStringStream *s, *r;
	UTF8String u;
	TBase64Encoding *Base64;

  try
	{
		Base64 = new TBase64Encoding(0,"");
		Jeton = Base64->Encode(Edit2->Text+":"+Edit3->Text);
		Memo1->Lines->Add("Jeton : '"+ Jeton+"'");


		u = "<D:propfind xmlnsBig Grin=\"DAV:\">\r\n"
		"<D:allprop />\r\n"
		//"<D:prop>\r\n"
			//"<D:creationdate />\r\n"
			//"<D:getlastmodified />\r\n"
			//"<D:quota-available-bytes/>\r\n"
			//"<D:quota-used-bytes/>\r\n"*/
		//"</D:prop>"
		"</D:propfind>";  //

		s = new TStringStream();
		s->WriteString(u);
		s->Seek(0, 0);
		r = new TStringStream();


	  try
	  {

		IdSSLIOHandlerSocketOpenSSL1->SSLOptions->SSLVersions << (TIdSSLVersion) ComboBox1->Text.c_str();
		IdSSLIOHandlerSocketOpenSSL1->SSLOptions->Method   << (TIdSSLVersion) ComboBox2->Text.c_str();

		IdWebDAV1->Request->UserAgent = USERAGENT;
		IdWebDAV1->Request->BasicAuthentication = true;
		IdWebDAV1->Request->Username = Edit2->Text ;
		IdWebDAV1->Request->Password = Edit3->Text ;
		IdWebDAV1->Request->Method = "PROPFIND" ;
		IdWebDAV1->Request->Accept = "*/*";
		IdWebDAV1->Request->CustomHeaders->Clear();
		IdWebDAV1->Request->CustomHeaders->Add("Content-Type: application/xml; charset=\"utf-8\"");
		IdWebDAV1->Request->CustomHeaders->Add("Host: webdav.yandex.com.tr");
		IdWebDAV1->Request->CustomHeaders->Add("Accept: */*");
		IdWebDAV1->Request->CustomHeaders->Add("Depth: 1");
		IdWebDAV1->Request->CustomHeaders->Add("Authorization: Basic "+Jeton);
		IdWebDAV1->DAVPropFind( Edit1->Text,s,r);
        Memo1->Lines->Add("---------Gelen Cevap-----------");
		Memo1->Lines->Add( r->DataString);
	  }
	  catch(Exception *HATA)
	  {
		Memo1->Lines->Add( HATA->Message);
	  }

	}
	__finally
	{
    Base64->Free();
	s->Free();
	r->Free();
	}

Nerde Hata Yapıyorum
Yardımlarınız için allah razı olsun
Cevapla
#2
karşı tarafda linux extx ve win den bildiğin fat,ntfs gibi bildiğin bir dosya sistemi yok haliyle fiziksel olarak klasör, dizin dosya mantığıda yok.
Cevapla
#3
(13-02-2020, Saat: 18:10)tavin44 Adlı Kullanıcıdan Alıntı: karşı tarafda linux extx ve win den bildiğin fat,ntfs gibi bildiğin bir dosya sistemi yok haliyle fiziksel olarak klasör, dizin dosya mantığıda yok.

hocam yandex disk girdiğimizde dosya ve dizinleri görebiliyoruz
bende o listeyi çekmek istiyorum

Yandex 
https://tech.yandex.com/disk/doc/dg/refe...t-docpage/

burda Listeyi Gösteriyor

HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset="utf-8"
Content-Length: 3079

<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:">
 <d:response>
   <d:href>
     /
   </d:href>
   <d:propstat>
     <d:status>
       HTTP/1.1 200 OK
     </d:status>
     <d:prop>
       <d:creationdate>
         1970-01-01T00:00:00Z
       </d:creationdate>
       <d:displayname>
         disk
       </d:displayname>
       <d:getcontentlength>
         0
       </d:getcontentlength>
       <d:getlastmodified>
         Thu, 01 Jan 1970 00:00:00 GMT
       </d:getlastmodified>
       <d:resourcetype>
         <d:collection/>
       </d:resourcetype>
     </d:prop>
   </d:propstat>
 </d:response>
 <d:response>
   <d:href>
     /Documents/
   </d:href>
   <d:propstat>
     <d:status>
       HTTP/1.1 200 OK
     </d:status>
     <d:prop>
       <d:creationdate>
         2012-03-24T09:00:43Z
       </d:creationdate>
       <d:displayname>
         Documents
       </d:displayname>
       <d:getcontentlength>
         0
       </d:getcontentlength>
       <d:getlastmodified>
         Sat, 24 Mar 2012 09:00:43 GMT
       </d:getlastmodified>
       <d:resourcetype>
         <d:collection/>
       </d:resourcetype>
     </d:prop>
   </d:propstat>
 </d:response>
 <d:response>
   <d:href>
     /readme.pdf
   </d:href>
   <d:propstat>
     <d:status>
       HTTP/1.1 200 OK
     </d:status>
     <d:prop>
       <d:creationdate>
         2012-04-09T10:56:13Z
       </d:creationdate>
       <d:displayname>
         readme.pdf
       </d:displayname>
       <d:getcontentlength>
         455833
       </d:getcontentlength>
       <d:getcontenttype>
         application/pdf
       </d:getcontenttype>
       <d:getlastmodified>
         Mon, 09 Apr 2012 10:56:13 GMT
       </d:getlastmodified>
       <d:resourcetype/>
     </d:prop>
   </d:propstat>
 </d:response>
</d:multistatus>

ancak Ben Almaya Çalıştığımda 
Gelen Bilgi
<?xml version="1.0" encoding="UTF-8"?><d:multistatus xmlns:d="DAV:"><d:response><d:href>/</d:href><d:propstat><d:status>HTTP/1.1 200 OK</d:status><d:prop><d:creationdate>2012-04-04T20:00:00Z</d:creationdate><d:displayname>disk</d:displayname><d:getlastmodified>Wed, 04 Apr 2012 20:00:00 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop></d:propstat></d:response></d:multistatus>
bu kadar
Cevapla


Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
  Projeye dosya olarak eklenmiş dosyanın içeriğini okumak yhackup 9 1.758 18-04-2025, Saat: 21:39
Son Yorum: bakyuz
  Windows Explorer dan delphi formuna dosya Drag&Drop işlemi örneği adelphiforumz 1 582 23-01-2025, Saat: 15:16
Son Yorum: yhackup
  Runtime ile SpinEdit toplamı alma denizfatihi 7 1.156 04-12-2024, Saat: 12:28
Son Yorum: yhackup
  Delphi IDE project kısmına Klasör ekleme yanniosman 1 563 01-12-2024, Saat: 12:17
Son Yorum: frmman
  idftp dosya kontrolü ercanskose 2 793 30-10-2024, Saat: 16:15
Son Yorum: ercanskose



Konuyu Okuyanlar: 1 Ziyaretçi