I am writing a file in localhost and when you click a button to export
itself opens a box save as. What does is to unload the file written
in localhost in the directory wich you choose in the box.
I have the problem that in localhost the file this good but in the chosen directory
the file has size of 0 bytes.
I would thank if somebody can help me with this I don't know
another thing to do.
I also send you my code in Javascript and Php wich I'm using.
Thank you very much,
HernĂ n Lagrange.
Code PHP:
if($ExportRes==1)
{
$fpw=fopen("planilla_horas.zip", "w");
$fpr=fopen ("planilla_horas.htm", "r"); $StrLimit='Apellido';
$buffer='Inicio';
while (!strstr($buffer, $StrLimit))
{
$buffer = fgets($fpr, 4096);
fputs ($fpw,"$buffer");
}
fclose ($fpr);
fclose ($fpw);
Code Javascript:
function Exportacion()
{
BusqHorasPorProyecto.ExportRes.value=1;
BusqHorasPorProyecto.submit();
}
function VerificaExportacion()
{
if(BusqHorasPorProyecto.ExportRes.value==1)
{
BusqHorasPorProyecto.ExportRes.value=0;
window.open("http://localhost/planilla_horas.zip","_blank");
}
}