Buenas estoy haciendo un codigo que respalda la base de datos a un archivo sql (funciona) y luego quiero que aparezca la tipica opción de guardar como en el navegador, la cual sale pero el archivo que guarda queda malo y me entrega este error, si alguien me puede dar una mano por favor.
<br />
<b>Warning</b>: filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for sistemas.sql\ in <b>C:\wamp\www\SCF\bajando.php</b> on line <b>22</b><br />
<br />
<b>Warning</b>: readfile(sistemas.sql\) [<a href='function.readfile'>function.readfile</a>]: failed to open stream: Invalid argument in <b>C:\wamp\www\SCF\bajando.php</b> on line <b>23</b><br />
El codigo (el archivo ya esta creado y bien)
Código:
<?php
$v="sistemas.sql";
$enlace = $v."\\".$id;
header ("Content-Disposition: attachment; filename=".$id."sistemas.sql");
header ("Content-Type: application/octet-stream");
header ("Content-Length: ".filesize($enlace));
readfile($enlace);
?>