I have been able to create the folder with the global asa on session start but on end 
the folder is not being deleted here is the code i am using. Ps i am using the fdf 
toolkit from acrobat to create my pdf's and I use a save button to download them. The 
only trouble is that when i try to overwrite the created pdf the server is getting an 
error (file already exists). What i am going to try is in the submit page i am going 
to delete the created pdf before it overwrites then create a new one each time instead.

Sub Session_OnStart
 Dim fldName
 fldName = (Session.SessionID)
 dim fs,f
     set fs=Server.CreateObject("Scripting.FileSystemObject")
     set f=fs.CreateFolder("C:\Myserverfileroot\my serverWebRoot\Temp\" & fldName )
     set f=nothing
     set fs=nothing

End Sub

Sub Session_OnEnd
 Dim fldName
 fldName = (Session.SessionID)
     dim fs,f
     set fs=Server.CreateObject("Scripting.FileSystemObject")
     set f=fs.GetFile("C:\Myserverfileroot\my serverWebRoot\Temp\" & fldName )
     f.Delete
     set f=nothing
     set fs=nothing
End Sub

What i think is happening is onEnd it is not able to grab the session ID(Some how i 
need to tell it wich session id to close just not sure how).
  ----- Original Message ----- 
  From: Parul Agarwal 
  To: [EMAIL PROTECTED] 
  Sent: Tuesday, May 18, 2004 2:24 AM
  Subject: Re: [AspClassicAnyQuestionIsOk] Create temp folder and delete on session 
ends Questions/Plea for help lol


  Hi,
  w.r.t your 1st question, use the fso for creating a
  folder where the pdf can be stored. The way you will
  be creating the folder, in the same way you can delete
  the folder plus the files. The code should look
  something like this:
  <code>
  Dim fso
  Dim File
  Dim FileSys
                          
  Set fso = Server.CreateObject
  ("Scripting.FileSystemObject")

  dim var
  var = URL
  Session("URL") = URL
  File = Server.MapPath(var)
  Set FileSys = fso.CreateTextFile(File,true)

  </code>

  pass the URL, or the folder name plus the file name to
  be created in the var URL.

  Use DeleteTextFile to delete the folder and files.

  HTH,
  Parul

    Question 1:
    I have a bunch of forms when a user submits it
  creates a pdf of the form. I was wondering if it is
  possible to create a temp folder of some kind on a
  2003 server that will house these temporary pdfs so
  that when the user closes the session with the server
  this temp folder with (lets 6 or 7 pdf in it) would be
  deleted from the server?

    Question 2:

    Will the pdf be able to overwrite them selves if the
  user changes data on the on the page that gives them
  the submitted results when they re submit the changed
  form. The pdf's are named from one of the fields that
  are mandatory on the forms. If that field is changed
  the the pdf would be renamed and overwrite would not
  be an issue.

    example scenario:

    there's a form with :
    Firstname: = Joe
    Lastname: = Jojomojo
    username: = pdfmisery
    password: = pdfisconfusing
    account number: =  1234


    user submits this form
    the pdf is called 1234.pdf and saved to temp folder.

    this form shows user what he submitted


    Firstname: = Joe
    Lastname: = Jojomojo
    username: = pdfmisery
    password: = pdfisconfusing
    account number: =  1234

    user changes Firstname to Joey

    Firstname: = Joey
    Lastname: = Jojomojo
    username: = pdfmisery
    password: = pdfisconfusing
    account number: =  1234

    user re submits form
    database is updated
    pdf is overwriten(as 1234.pdf) and saved to temp
  folder with new info in it so the user can download
  it.

    user closes browser
    in five minutes of no actions with server the server
  ends the session and destroys the temp folder with
  those pdf's inside. Is this possible and if so could
  someone post some sample code to create the folder and
  destroy it. Any help would be greatly appreciated. And
  thanks in advance for eventaking the time out of your
  day to even read this.(If possible I would like the
  global.asa to be doing this)

    [Non-text portions of this message have been
  removed]



  ------------------------------------------------------------------------------
    Yahoo! Groups Links

      a.. To visit your group on the web, go to:
     
  http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
        
      b.. To unsubscribe from this group, send an email
  to:
     
  [EMAIL PROTECTED]
        
      c.. Your use of Yahoo! Groups is subject to the
  Yahoo! Terms of Service. 




  [Non-text portions of this message have been removed]


  Yahoo! Groups Sponsor  ADVERTISEMENT


  ---------------------------------
  Yahoo! Groups Links

     To visit your group on the web, go to:
  http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

     To unsubscribe from this group, send an email to:
  [EMAIL PROTECTED]

     Your use of Yahoo! Groups is subject to the Yahoo!
  Terms of Service.


  ________________________________________________________________________
  Yahoo! India Matrimony: Find your partner online. 
http://yahoo.shaadi.com/india-matrimony/

        Yahoo! Groups Sponsor 
              ADVERTISEMENT
             
       
       


------------------------------------------------------------------------------
  Yahoo! Groups Links

    a.. To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
      
    b.. To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]
      
    c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/saFolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to