Osiris Posted March 10, 2005 Report Share Posted March 10, 2005 Ir kods lai lietotājs varētu lejupielādēt failu: header("Content-Description: File Transfer"); header("Content-Type: application/force-download"); header("Content-Length: " . filesize($file)); header("Content-Disposition: attachment; filename= name.xls"); readfile($file); Atveras dialogs, piedāvā seivot, bet, ja uzspiest "Cancel", pēc tām atakl "Download", un tā pāris-trīs reizes, output sanāk negaidīts. Kas var būt par problēmu? Link to comment Share on other sites More sharing options...
tamster Posted March 10, 2005 Report Share Posted March 10, 2005 Atveras dialogs, piedāvā seivot, bet, ja uzspiest "Cancel", pēc tām atakl "Download", un tā pāris-trīs reizes, output sanāk negaidīts. 14875[/snapback] ne īsti sapratu. negaidīts? Link to comment Share on other sites More sharing options...
Osiris Posted March 10, 2005 Author Report Share Posted March 10, 2005 ne īsti sapratu. negaidīts? 14886[/snapback] Man liekas IE atver to failu, neskatoties uz Content-Disposition: attachment. Es tē palasīju citur, un atradu šo: @header("Connection: close"); pirms readfile($file); It kā stradā, bet nezinu cik tas ir pareizi... Link to comment Share on other sites More sharing options...
kirils Posted March 10, 2005 Report Share Posted March 10, 2005 kas tas Tev par mediatype "application/force-download" ? un peec = pirms failneima, labaak neliec atstarpi Link to comment Share on other sites More sharing options...
Osiris Posted March 10, 2005 Author Report Share Posted March 10, 2005 (edited) 14891[/snapback] Bet kapēc nē? vai viens, vai otrs: header("Content-Type: application/octet-stream"); header('Content-Type: application/force-download'); Par filename - paldies Edited March 10, 2005 by Osiris Link to comment Share on other sites More sharing options...
kirils Posted March 10, 2005 Report Share Posted March 10, 2005 Bet kapēc nē? nu taapeec, ka AFAIK nav taada media subtype kaa force-download. ir octet-stream, jaa. Link to comment Share on other sites More sharing options...
Osiris Posted March 10, 2005 Author Report Share Posted March 10, 2005 14895[/snapback] Nu, nezinu... Pat Manuālā atrodu komentos, un ne tikai tur. Bet, galvenais, kā viss tagad stradā (ar @header("Connection: close");). Link to comment Share on other sites More sharing options...
Venom Posted March 11, 2005 Report Share Posted March 11, 2005 nu taapeec, ka AFAIK nav taada media subtype kaa force-download. ir octet-stream, jaa. tie MIME tipi jau tāda slīpa padarīšana vien ir, arī tas, ka iekšā ir mime tips, nenozīmē, ka tam atbilst arī tālākejošie dati (gribi *.raru, kuru var nospēlēt winampā - man tād ir) tā kā downloadam var bliezt vienalga ko nesaprotamu, lai uz klienta datora neatrastos programmas, kurai sagribētos atvērt to failu sevī Link to comment Share on other sites More sharing options...
рпр Posted March 11, 2005 Report Share Posted March 11, 2005 filename likt labaak peedinjaas. Link to comment Share on other sites More sharing options...
Venom Posted March 11, 2005 Report Share Posted March 11, 2005 un iconvēt uz iso-western Link to comment Share on other sites More sharing options...
kirils Posted March 12, 2005 Report Share Posted March 12, 2005 tie MIME tipi jau tāda slīpa padarīšana vien ir, arī tas, ka iekšā ir mime tips, nenozīmē, ka tam atbilst arī tālākejošie dati (gribi *.raru, kuru var nospēlēt winampā - man tād ir)tā kā downloadam var bliezt vienalga ko nesaprotamu, lai uz klienta datora neatrastos programmas, kurai sagribētos atvērt to failu sevī 14898[/snapback] izmantot neexisteejoshus (neregjistreetus) media type nav ieteicams; es nebuut nerunaaju par mediatype atbilstiibu reaalajam kontentam, bet par to, ka taads tips vispaar nekur (tb ICANN) nav regjistreets. Link to comment Share on other sites More sharing options...
makakaz Posted June 8, 2005 Report Share Posted June 8, 2005 Par sho teemu uzraku skriptu, ceru ka noderees :) http://paste.php.lv/2099 Link to comment Share on other sites More sharing options...
Recommended Posts