Beveiliging van bestanden (links)

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Pagina: « vorige 1 2

- Ariën  -
Beheerder

- Ariën -

20/01/2015 22:07:06
Quote Anchor link
Ik geloof dat deze header niet veel doet dan alleen een standaard naam te geven, en niet te linken.
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.
 
PHP hulp

PHP hulp

15/05/2024 06:03:17
 
Peter  Flos

Peter Flos

20/01/2015 22:33:26
Quote Anchor link
In je Database moet je de ../map/ neerzetten. Volgens $file bestaat het bestand namelijk nogsteeds niet omdat deze regels hoger staat.
 
- Ariën  -
Beheerder

- Ariën -

20/01/2015 22:35:43
Quote Anchor link
Ik zou die locatie van de map juist niet in de database plaatsen, maar hardcoded in je script.

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 -
 
Peter  Flos

Peter Flos

20/01/2015 22:47:06
Quote Anchor link
Goed punt.
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
<?php
$file
= "../fileuploads/".$data['file'];
?>


Wordt t dan :)
 
Jordy Heer

Jordy Heer

20/01/2015 22:49:19
Quote Anchor link
OK dank jullie wel. Heb het aangepast, maar krijg nu allemaal foutmeldingen.

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¹Vj­G˜êñÔ!Ðê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ÚŽi00ºÎ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€0­7YË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“4N `@ÀÎ#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Ö:ÃÇ@hHÆ:ƒ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
 
- Ariën  -
Beheerder

- Ariën -

20/01/2015 22:52:36
Quote Anchor link
Er mag geen output voor headers komen te staan. Zie config.php lijn 32.
Ik gok witruimte, want een config hoort niks te echo'en.
 
Jordy Heer

Jordy Heer

20/01/2015 22:57:46
Quote Anchor link
hmmmz stonden wel wat witte regels in config.php. Maar nog steeds errors

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
 
- Ariën  -
Beheerder

- Ariën -

20/01/2015 23:02:36
Quote Anchor link
ob_start is een houtje-touwtje oplossing die later voor meer problemen kunnen zorgen. Niet gebruiken dus!!!



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 -
 
Jordy Heer

Jordy Heer

20/01/2015 23:05:10
Quote Anchor link
Ha klopt, stond een echo.
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
 
- Ariën  -
Beheerder

- Ariën -

20/01/2015 23:05:40
Quote Anchor link
Juiste pdf-headers meegeven. Kan je zo opzoeken ;-)
 

Pagina: « vorige 1 2



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.