delete files in webspeed

uranicjhonny

New Member
Hello everyone

I have the following problem
'll explain step by step
1.- in my page I need to create a file
2.- show me the file in the page,
3.- and I either delete the file when you click to a button or when you exit the page
Well, step one al 2 is solved, but in step three is where I have problems
this is my page code

Code:
<SCRIPT LANGUAGE="SpeedScript">
if get-value("finumero") <> "" then do:
/* Create an unnamed pool to store all the widgets created by this procedure.
This is a good default which assures that this procedure's triggers and
internal procedures will execute in this procedure's storage, and that
proper cleanup will occur on deletion of the procedure. */
CREATE WIDGET-POOL.
Define variable cookievar as c.
DEF VAR vcl-paramext AS CHAR NO-UNDO.
DEF VAR vcl-parametrobat AS CHAR NO-UNDO.
DEF VAR vcl-random AS INTEGER NO-UNDO.
DEF VAR vcl-pdf AS CHAR NO-UNDO.
DEF VAR vcl-liga AS CHAR NO-UNDO.
DEF VAR vcl-fiNumero as CHARACTER NO-UNDO.
DEF VAR vcl-gen AS CHARACTER NO-UNDO.
DEF VAR finumero AS CHARACTER NO-UNDO.

/*Se hace el procedimiento output-header para generar la cookie*/
assign finumero = get-value("finumero"). /*le asignamos a una variable de tipo caracter el valor de lo que se captura*/
IF Request_Method = "Post" THEN DO:  
Procedure Output-header: 
       FIND Customer WHERE Customer.custnum = int(get-value("finumero")) NO-LOCK NO-ERROR.    /*Hacemos una busqueda al numero captura, convirtiendolo a entero el valor capturado*/
       IF AVAILABLE Customer THEN DO:
         vcl-random = RANDOM(1, 100000).
         vcl-pdf = "11CLIENTES" + string(vcl-random) + string(get-value("fiNumero")).

         vcl-liga = "http://192.168.1.89/pdfs/11CLIENTES" + string(vcl-random) + string(get-value("fiNumero")) + ".pdf".
         vcl-paramext = "sports2000.invoice.custnum" + CHR(1) + string(get-value("fiNumero")).    /*A la variable se le asigna los valores del campo capturado y a que Base de datos y que tabla lo va a buscar*/

     /*Se le asigna a las variables para pasarlo al .bat*/
         vcl-parametrobat = "invitado" + "$" +            /*Nombre usuario*/
                             ENCODE("invitado") + "$" +         /*Password Usuario*/
                            "FALSE" + "$" +             /*Conectar Appserver*/
                            "1@1@Clientes" + "$" +         /*Nombre Del Reporte*/
                            vcl-paramext + "$" +         /*Parametros Externos*/
                            "FORMA" + "$" +             /*Opcion: Forma/Browse/Grafica/Texto*/
                            "TRUE" + "$" +             /* Batch ? */
                            "" + "$" +                /* Nombre de vista de la forma */
                            vcl-pdf + "$" +            /* Nombre de archivo .pdf */
                            "FALSE".                /* envia por e-mail el archivo .pdf ? */
        set-cookie("testcookie":U, vcl-pdf, ?, ?, ?, ?, ?).     /*genera la cookie, pasandole valores como un nombre(testcookie), el nombde del pdf, los demas valores pueden quedar como estan*/
        OS-COMMAND SILENT C:\curso_handa\pages\InvocaBAT.bat VALUE(vcl-parametrobat). 
        /*output-http-header("status","302").*/
        output-http-header("location", vcl-liga).
        /*output-http-header("","").*/ 
        OS-COMMAND SILENT DEL VALUE('C:\Inetpub\wwwroot\pdfs\' + vcl-pdf  + '.pdf').
        END. 
End Procedure.  
END.
end.
</SCRIPT>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<META NAME="AUTHOR" CONTENT="Alex Pearlstein">
<TITLE>Reporte de Estadisticas de Venta WEBSPEED</TITLE>
</HEAD>

<BODY Onload="show5()">
<div id="wb_Image1" style="position:absolute;left:32px;top:0px;width:750px;height:79px;z-index:1;" align="left">
<img src="http://192.168.1.89/images/top.gif" id="Image1" alt="" align="top" border="0" style="width:750px;height:79px;"></div>
  <br>
  <br>
  <br>
  <br>
<TABLE>
    <TR>
      <TD> 
        <B> 
        <FONT SIZE="5" TYPE="Arial" > Reporte de Estadistica de Venta  </FONT> 
        </B> 
       </TD>
      </TR>
</TABLE>
  <BR>
  <BR>
<Form method="Post" Name="cookieform" action="Customerws3.html">
<input type="text" name="finumero" value="` finumero `" onchange="document.cookieform.submit();">
<a href=`vcl-liga` onclick="document.cookieform.submit();">&nbsp;PDF</a>
</form> 
<BR><BR>
<TABLE>
    <TR>
      <TD> 
        <a href="http://192.168.1.89/scripts/cgiip.exe/WService=wsbroker1/pages/menurep.html">Regresar</a>
       </TD>
    </TR>
</TABLE>         
<hr noshade="noshade" size="7" width="705" color="#40E0D0" id="Line1" style="margin:0;padding:0;position:absolute;left:22px;top:120px;width:705px;height:7px;z-index:11">
<hr noshade="noshade" size="8" width="707" color="#40E0D0" id="Line2" style="margin:0;padding:0;position:absolute;left:22px;top:415px;width:707px;height:8px;z-index:12">
</BODY>
</HTML>
as summer if we take the following command
OS-COMMAND SILENT DEL VALUE('C:\Inetpub\wwwroot\pdfs\' + vcl-pdf + '.pdf').
PDF page shown.

The problem is that you need to delete the file created, and the code that creates the file, deletes it but does not show because there.

any idea to delete the file and display the pdf on the page?

Thanks for your answers
 
Top