Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
Dosya İndirme
#1
Merhabalar,

Bir url var, bu urli tarayıcı yazınca doğrudan pdf açılıyor bunu alıp kaydedebiliyorum, fakat başka bir url var tarayıcıya yazdığımda pdf açılmıyor doğrudan indiriyor.
Bunu yakalayamadım site https ve  cleverin TclHttp  componetini kullanıyorum.

Farklı ayarlarla aldığım farklı hatalar  Smile

Exception: An established connection was aborted by the software in your host machine.
Exception: The function requested is not supported
Exception: An existing connection was forcibly closed by the remote host.
Exception: An established connection was aborted by the software in your host machine.
WWW
Cevapla
#2
Exclamation 
Sorumu Değiştireyim TclHttp Requestiin Content-Disposition  'unu kapatabilir miyim ?

var
 Response: TMemoryStream;
begin
 try
     Response := TMemoryStream.Create;
     try
       clHttp1453.Get('https://xxxxxxxxxxxx',Response);
       Response.Position := 0;
       Response.SaveToFile('C:\blabla.pdf');
     finally
       Response.Free;
     end;
 except on E: Exception do Memo2.Lines.Add(e.Message);
 end;
end;
WWW
Cevapla
#3
Hocam işini görür mü bilmem ancak url den birşey çekerken şöyle kullanıyorum.

uses URLMon;

 if URLDownloadToFile(nil, PChar(URL_ADRES), PChar(DOSYA_ADRESI), 0, nil) = S_OK then
   begin
     Result := True;
   end;


yada 

var
  FileName: String;
begin
        SetLength(FileName, MAX_PATH + 1);
        if URLDownloadToCacheFile(nil, PChar(URL), PChar(FileName), MAX_PATH, 0, nil) = S_OK then
          begin
            Result := True;
          end;
end;
Cevapla
#4
Denemiştim ama indirmiyor,

Fakat işin ilginç yanı, bu url'de ip kısıtlaması var, ip'si tanımlanan yere proxy kurdum kendimde debug etmek için,

Kendi bilgisayarımda clHttp1453 nesneme proxy bilgisi girdiğimde dosyayı indirdi. proxy bilgisini silip tekrar ip'si tanımlı bilgisayara attım indirmiyor. tam çıldırmaca.
WWW
Cevapla


Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
Lightbulb Delphi 7zip Password lü Dosya Sıkıştırma ve Açma + Bonus RAR5 Desteği frmman 6 262 16-03-2024, Saat: 17:55
Son Yorum: delphi.developer
  Dosya isimlendirme bydelphi 6 480 16-01-2024, Saat: 16:38
Son Yorum: mustafaozpinar
Exclamation dosya özellikleri değiştirme erdogan 1 295 09-10-2023, Saat: 16:09
Son Yorum: hi_selamlar
  Yandex Disk üzerinden TIdWebDAV ile nasıl dosya alabilirim adelphiforumz 2 843 17-03-2023, Saat: 16:53
Son Yorum: adelphiforumz
  Dosya content type bulma tuna 7 1.764 18-01-2023, Saat: 20:29
Son Yorum: tuna



Konuyu Okuyanlar: 1 Ziyaretçi