Beveiliging van bestanden (links)
Zoals ik al zei: plaats op de plek waar $file aangemaakt wordt het volledige pad neer. Die basename() maakt er vanzelf wel de juiste filename van, voor de handigheid en voor de downloader.
In je Database moet je de ../map/ neerzetten. Volgens $file bestaat het bestand namelijk nogsteeds niet omdat deze regels hoger staat.
Stel je voor dat je de locatie van de bestanden aanpast naar een ander path, dan moet je ook weer alles in je database aanpassen.
Gewijzigd op 20/01/2015 22:36:36 door - Ariën -
Warning: Cannot modify header information - headers already sent by (output started at public_html/config.php:32) in public_html/download_check.php on line 25
Warning: Cannot modify header information - headers already sent by (output started at public_html/config.php:32) in public_html/download_check.php on line 26
Warning: Cannot modify header information - headers already sent by (output started at public_html/config.php:32) in public_html/download_check.php on line 27
Warning: Cannot modify header information - headers already sent by (output started at public_html/config.php:32) in /public_html/download_check.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at public_html/config.php:32) in public_html/download_check.php on line 29
Warning: Cannot modify header information - headers already sent by (output started at public_html/config.php:32) in public_html/download_check.php on line 30
Warning: Cannot modify header information - headers already sent by (output started at public_html/config.php:32) in public_html/download_check.php on line 31
%PDF-1.3 %’ ¢Š 4 0 obj <>] /Length 30937 >> stream ÒÈï"C¡Ô!ÖÇ\¹Mb©bõ¢šÅÉÕ®C¡Ô'Z¥k×¢Ô:TL¹VjG˜êñÔ!Ðê1Ô!Ðê+ÇQŽÚ\:Œuê1Õ¡ûCñ¾:¼uê1Ôc¨C÷Ž®Œuxê1Õ§V¹:Ž‡N±³Ìu~WŽ¯D:Œ~!Óèq£F:ˆuxûã÷Ž£D:|t:v:|~1ÔcOŽ¡:Žî¡†'B®÷à"¥#®EÑŒuhuhuˆt,¦‡Cã¡ÐètéÓ¬WŽ£Bf:Œupêètøüc«ÇV‡P‡C¨ÇQ£áÐêÐü<³Ä:´:ÈŒ±Zt:Ž‡C«P¡:ÙRf¤HÒȦ‹R4²)¢Ô€M¤ idSE©š-HÑj@¦–@4Z)¢Ô€M,€ hµ SE©šYÑj@˜ÇÇC«I§Hã„šÐL7Cð“N&1ñÐû:Mm RnÇá:M F‡ 4éaÂM:@¤!Ðü$Ó¤ … 5 ¤âu 4é“Ìu 4é“tøû¤Ó¤ ÂM:@˜Cã˜ètšÐRCã¡øI§HíÒk’hp‡I£T€0c¡ô×$ ƒ¦¹ Rc¡áÐé5X˜PÇí&R'pòjÒ¼~Òht€IŽ‡C§I¤à‡4Ö$ ŒqÚM)7ÇN‡I«H Øþ$Ñ`Çc¡ÒiÒ!º´š5H Ó´ÒpI»}5‰“F:´š Rn‡‡ÓX&7ŸMV&vètš5HøæšÄ€IÄ>šN)1Øèui4:@˜c’kÁZM&ã¡ëI£T€IŽ‡céªÀÂ<>šÄ€Iº}5‰“t><šÄ€0hÕ Lè~iÒ&ì}5É4*j°0C¡Ô$Ó¤ BÂM:@˜P‡i®H›·á&‡H鈴 Rn‡C¡ôÖ$ Œv>šN&èziÒÆ;Mr@¤ÝÂM:@˜OÆšä€05ɇCð“N&øøü$Ö€a8ÓIÀ&:}Ô$Ó¤ Ní5Éc“IÀÃMr@˜ü$Ö€“|t? 5 ˜úk’ÂBMh)|}4œLí4œL(ÇC¨M'p‡L×›¡ñö—1Éš8˜YŽ¡4ž™®)!Øó¦ê¡l$’¦‹t<Ýd#-Ãã¹-Í&7YÇC›-Œ~FI¢À&ì~uR™mŽ‡r[C¦‹ ñÐûu‘²Ø£ò[Ú0Lóu˜t;e°›ÙÁ¤ HtíÓr@Œ¶C¡ÖÀöq0HC¡øMÕqØû-±áÖÀöq00žn²Ç‡L¶`iœPL+‡MÖB2ÛÙ„:g›¡ñøMÕaÐè}–ÂìÂ3‰€ Ht:›¬„e¶9lÕ#!¬BPÝdÚŽi00ºÎ8Ùl‡Cê9ÊÆ ¾\EêñÐ̃/Fœ¿2 L1Ðô&ê°ðû-…Qˆà‹üçºÒ„^Ìž]bNÝdÉ ¤‡c𛪘øé–Âíct_é:tOBP ŠÔÒÐ…4 b½àa>:n²–Èt>Þ#š•ôÔoºƒ_Ö‡^†*!ö‡L‡6ü&ê°ðû-±ÍE¡ÐÊh"Qð”eÿëC¯Ceûñ2¤ €ÖqÆËbŽ€¼C¡™ÐèBQŠêy4:'Þ£…É€HC¡öë!l‡fc"Ì"!Ô ™<Ÿr´êi‘“„:„ÝVe¶9ÝŽ‡C„„:Œa^òµ i€07YËbƒÝ|1‡C0™"î‚C¢äa:¢d@¤á‡Û¬˜è}–Øèv BøMÂtC¢hœÔ!òèiÎ74H›±÷N›©Ã“-Œ|&:š'‡Iàht*Œ$™;n™„:tÜQÓ-±Ì"RN‡HB1n–)„ÝUŽ‡C¦[ _<þ©5º¾!ñIÒuúuø…ø„ˆ}’€“7Y‡&[c‘|èt?Z>]F1£½ñˆt’_§_§C¬ËèO›™¤ Eˆt:n²–Æ<_:“óÁ¡áu„:H‡Ä.«úN ÁÇC¦B$8á7U!Ðé–ÌsˆqJèÐI$#s!|v<Èj)n²c¶[‡câ#áJ¦‚%Q—CžÝ2:@˜Ç‡CíÖ!áö[öÕvƒD€HCã¨MÕB2ØVa"@˜¦ë!mŽLÂD€HÇCã¨MÕaÐí–Æ<Ì$H‚·Yû-…f$ ƒÂnª–³GäÝf™n³ ÀÇÛ¬˜è}–ÅfŽ) ÐûuŒ¶š8¤ÝE º¬92Ü:fŽ&(mÖL|tËaY„‰’x}ºÌ92Ø£ìÑÀÀFë$<ËaY£€ €˜›©Š:e³fŽ&1çÛ¬±Í—3 ÃtÝf6)P;u#Œyš8˜Ç1ñÓrB6)À¬ÑÀÆ;tÝd!±K4JÂ3GíøMÕ!Ðøè¸9±Ý“è}š8˜7C¦ë!D›9…fŽ&!Øëu1GÕãmŒu#PŒÂD€0(ûuˆt;&fÚ=KfƒfŽ&1øÛ¬Š:&fÚcª‹fCfŽ)|}ºÈUxü„ô·Åe³(rf$ ŒsBn«‡5nU†t‚ìY§‡B†@¶h#0‘ RN‡mÖE0´‡0`@hÐ3ƒ1Ðå±f0Á²í:¢ó0‘ L}ÓrA“4N `@ÀÎ#OÌ„?{c/Ž‹ÈÅB3G<ÝdÇ5xúA¡";ˆ†±ÑÝxéNŠxt#eïŠæÌ$Hèsn²cš³uÂ#±ØˆiŸVÂÇ«ü}#/ˆeÙ{²‘3 Æ<<ÝfW€Ýp‡F1ˆ†±ÑÝf܃¢„‘—1»/dTš8¤Ó¦ä‚Ž‰˜Oˆtb#±1í9/Cë'Òc¢ðèC.Ë×f$ „éÛ¦äUà Ýd*³uÂ1ÔÙxìELF:¶$1¤> "0Æv]—¬ÊXæÍLCΛ¬ÃÃÊáÐ:OˆŽÆ41•1™dÐꑃOƒC¢ì½fR1öa"@˜ º¨£êÌ ×gc$1Ö:ÃÇ@hHÆ:ƒeñÑ{™A3 á7Y1ÍY´ø†v2F: c®ÇBf•¤!цœÂ2øè½Æ.Ç6hàaÂnªYºá Ȇã¯bl !£ë Œ»/ÌÅEf$ HxzuQ]+‡CUpˆ‡[!§†Ÿ˜Ì†©†‡G¡(u1Ò†_¦b¡„‰‡
Gewijzigd op 20/01/2015 23:03:27 door Jordy Heer
Ik gok witruimte, want een config hoort niks te echo'en.
Warning: Cannot modify header information - headers already sent by (output started at public_html/download_check.php:24) in public_html/download_check.php on line 29
Warning: Cannot modify header information - headers already sent by (output started at public_html/download_check.php:24) in public_html/download_check.php on line 30
Warning: Cannot modify header information - headers already sent by (output started at public_html/download_check.php:24) in public_html/download_check.php on line 31
Warning: Cannot modify header information - headers already sent by (output started at public_html/download_check.php:24) in public_html/download_check.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at public_html/download_check.php:24) in public_html/download_check.php on line 33
Warning: Cannot modify header information - headers already sent by (output started at public_html/download_check.php:24) in public_html/download_check.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at public_html/download_check.php:24) in public_html/download_check.php on line 35
Heb het volgens mij nu opgelost met ob_start();
Nu nog misschien een kleine vraag, wellicht een gemakkelijker antwoord :)
Nu download hij de file, kan hij hem ook alleen openen bijvoorbeeld?
Wanneer ik nu een PDF bestand aanklik (oude manier) opent hij het bestand. Nu download ie het bestand.
Gewijzigd op 20/01/2015 23:06:05 door Jordy Heer
Kijk eens naar download_check.php:24, oftewel lijn 24. Daar staat ook output.
Gewijzigd op 20/01/2015 23:03:01 door - Ariën -
Dat houtje touwtje oplossing heb ik bijna op elke pagina toegepast :), dus ga toch maar eens de site goed doorlopen :).
Bedankt iig. Nu nog ondervinden om het bestand te openen ipv downloaden. Dan is het volgens mij safe :D
Juiste pdf-headers meegeven. Kan je zo opzoeken ;-)