captcha vraagje

Gestart doorRobindb84 reacties432 weergaven

85 berichten · pagina 2 van 6

Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Robindb schreef:
dezelfde groote als wanneer ik hem uploade
Kunnen we concreet antwoorden i.p.v. die oeverloze glazen bol antwoorden..
Hartelijk dank!!!!!!!!!!!!!!!!!
0
Robindb

Lid · Topicstarter

Berichten
538
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dezelfde groote als het geuplaode bestand
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Zucht, zucht, en nog eens een dubbele zucht.....

Nog een keer!
Aarclay schreef:
En hoe groot is het bestand zelf op je FTP?
0
Robindb

Lid · Topicstarter

Berichten
538
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
let op
ik upload het bestand (voorbeeld 83 kb)
dan is hij op FTP ook 83 kb
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
83 kb dus, kijk, nu komen we wat verder.

En wat zegt de filesize() van PHP over dat bestand?
0
Robindb

Lid · Topicstarter

Berichten
538
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ok bestand wat ik heb geupload is

(39,538 bytes)

en filesize zegt

=> 41498 ) )
0
Robindb

Lid · Topicstarter

Berichten
538
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ja al gedaan
hier is url
http://resolvz.nl/index.php
registreren en dan upload je een afbeelding
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Quote:
Date: Fri, 02 May 2014 10:37:20 GMT
Server: Apache/2
X-Powered-By: PHP/5.4.26
content-transfer-encoding: Binary
Content-Disposition: attachment; filename=""
Vary: User-Agent
Content-Length: 0
Keep-Alive: timeout=1, max=100
Connection: Keep-Alive
Content-Type: application/octet-stream

Filename is leeg....
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Je overschrijft je assoc met variabele $q die je ook voor je query gebruikt, gebruik daar eens iets normaals voor, zoals $data.
Ik denk dat readfile over zijn nek gaat, als de filename in "Content-Disposition" leeg is.

Zou je ook eventjes je titel aan willen passen naar iets duidelijkers?????
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Codeblok (voorbeeld.php):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28


require_once(config.php);

if(isset($_GET[id])) {
$q = $mysql->query("SELECT COUNT(id) AS founds, fileName, baseName FROM files WHERE baseName = ".$mysql->real_escape_string($_GET[id])." LIMIT 1");
$q = $q->fetch_assoc();

$file = "./uploads/".$q[fileName];
if($q[founds] == 0 && file_exists($file)) {
header(Content-Description: File Transfer);
header(Content-Type: application/octet-stream);
header(Content-Disposition: attachment; filename=".basename($file).");
header(Content-Transfer-Encoding: binary);
header(Connection: Keep-Alive);
header(Expires: 0);
header(Cache-Control: must-revalidate, post-check=0, pre-check=0);
header(Pragma: public);
header(Content-Length: . filesize($file));
readfile(./uploads/.$file);
}
else {
header("Location: ./index.php");
exit();
}
}
else {
header("Location: ./index.php");
exit();
}

?>

Weird, nu download die dit:
Afbeelding
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$result[/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]$data[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$result[/COLOR][COLOR= #007700]->[/COLOR]fetch_assoc[COLOR= #007700]();[/COLOR]
?>


En gebruik dan:
$data[fileName] etc...
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Codeblok (voorbeeld.php):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27


require_once(config.php);

if(isset($_GET[id])) {
$result = $mysql->query("SELECT COUNT(id) AS founds, fileName FROM files WHERE fileName = ".$mysql->real_escape_string($_GET[id])." LIMIT 1");
$data = $result->fetch_assoc();
$file = "./uploads/".$data[fileName];
if($data[founds] == 1 && file_exists($file)) {
header(Content-Description: File Transfer);
header(Content-Type: application/octet-stream);
header(Content-Disposition: attachment; filename=".basename($file).");
header(Content-Transfer-Encoding: binary);
header(Connection: Keep-Alive);
header(Expires: 0);
header(Cache-Control: must-revalidate, post-check=0, pre-check=0);
header(Pragma: public);
header(Content-Length: . filesize($file));
readfile($file);
}
else {
echo("Location: ./index.php");
exit();
}
}
else {
echo("Location: ./index.php");
exit();
}

?>
0
Robindb

Lid · Topicstarter

Berichten
538
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
yes hij doet het
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren