hallo ik heb probleem
vraagje dit is mijn contact.php
laat maar
vraagje dit is mijn contact.php
laat maar
header(Content-Type: application/octet-stream);
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename="" . $q[fileName] . """);
readfile(./uploads/.$q[fileName]); if(file_exists(./uploads/.$q[fileName])) {
header(Content-Type: application/octet-stream);
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename="" . $q[fileName] . """);
readfile(./uploads/.$q[fileName]);
} else {
echo "Bestand bestaat niet!";
} Array ( [file] => Array ( [name] => Snapshot_20140425_3.JPG [type] => image/jpeg [tmp_name] => /tmp/phprPEoSB [error] => 0 [size] => 39538 ) ) [COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$q[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(id) AS founds, fileName, baseName FROM files WHERE baseName = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]real_escape_string[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" LIMIT 1"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$q[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$q[/COLOR][COLOR= #007700]->[/COLOR]fetch_assoc[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$q[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]founds[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Content-Type: application/octet-stream[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Content-Transfer-Encoding: Binary"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Content-disposition: attachment; filename=""[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$q[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]fileName[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/readfile"]readfile[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]./uploads/[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$q[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]fileName[/COLOR][COLOR= #007700]]);
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Bestand bestaat niet!"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: ./index.php"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();
}[/COLOR] [COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$q[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(id) AS founds, fileName, baseName FROM files WHERE baseName = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]real_escape_string[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" LIMIT 1"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$q[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$q[/COLOR][COLOR= #007700]->[/COLOR]fetch_assoc[COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$q[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]founds[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]./uploads/[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$q[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]fileName[/COLOR][COLOR= #007700]])) {[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Content-Type: application/octet-stream[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Content-Transfer-Encoding: Binary"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Content-disposition: attachment; filename=""[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$q[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]fileName[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]"""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/readfile"]readfile[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]./uploads/[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$q[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]fileName[/COLOR][COLOR= #007700]]);
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Bestand bestaat niet!"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: ./index.php"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();
}[/COLOR]
?> header("Content-length: " . filesize(./uploads/.$q[fileName]));