Save data on server with asp script

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default Save data on server with asp script

    Hi all !
    I did al lot of reading over the last few days and so far I'm still not as fasr as I want to :)

    I have my director script for my submit button:

    on mouseUp me
    thePath = "/cgi-local/hscoredata/"
    theFile = "highscore.txt"
    myString = "test"
    theMode = 2
    netID = postNetText ("http://www.pizzaplace.de/cgi-local/hscore.asp",["path":thePath,"filename":theFile,"filestring":myS tring,"mode":theMode])
    go "Result"
    end

    and here is the asp script (can anyone tell me whats wrong... please ;( )

    <%@ LANGUAGE = "VBScript" %>
    <%
    On Error Resume Next
    ' Constants for FileSystemObject
    Const ForReading = 1, ForWriting = 2, ForAppending = 8

    'Form Variables
    Dim fPath, fName, fString, fMode

    fPath = Request.Form("path")
    fName = Request.Form("filename")
    fString = Request.Form("filestring")
    fMode = Request.Form("mode")

    'Test form variables

    If fPath = "" Then
    Response.Write "File path name is not specified"
    Response.End
    End If

    If fName = "" Then
    Response.Write "File name is not specified"
    Response.End
    End If

    If fMode = "" Then
    fMode = 8
    Else
    fMode = CInt(fMode)
    End If

    'Start processing

    ' Lock the application
    Application.Lock

    ' Create a file system object and open the count file for reading
    Set Fs = CreateObject ("Scripting.FileSystemObject")


    'Check folder exists
    If Not Fs.FolderExists(Server.MapPath(fPath)) Then
    Fs.CreateFolder(Server.MapPath(fPath))
    End If

    'Check file exists
    If Not Fs.FileExists(Server.MapPath(fPath & fName)) Then
    Fs.CreateTextFile(Server.MapPath(fPath & fName))
    End If

    'map the path
    sPath = Server.MapPath(fPath & fName)

    ' Open the file
    Set theFile = Fs.OpenTextFile(sPath, fMode)

    'Check the mode
    If fMode = 1 Then
    'opened as read only
    Response.Write theFile.ReadAll()
    Else
    ' Write the string to the file
    theFile.Writeline(fString)

    ' Close the counter file
    theFile.Close
    Response.Write "Done"
    End If

    ' Unlock the application object
    Application.Unlock

    ' Release File system object and file

    Set Fs = Nothing
    Set theFile = Nothing
    %>


    It's not really doing anything, but I think it looks right... >( could the path be wrong ? can someone explain a relative path ?
    I set the script on chmod 755 and the textfile to 666 is that right ? The server handles different php and pl scripts I really think its supports asp too....
    Help :)

    Thank You
    Daniel




    Sorre webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. 6.1 script not working on 7.0 server. Script used towork!
      I've a problem with some coldfusion 6.1 scripts running on a server with coldfusion 7. It seems that it isn't accepting the hidden type for the tag...
    2. Save script error text?
      Hi, i just wondererd, when I receive an alert when I test a movie in Director, is it possible to retrieve the text of that alert? For example,...
    3. ITC - urgent!!!I'd like to transmit binary data from SQL server to client and load it into variable. I used for this Microsoft Internet Transfer Control and my script looks like this:
      I'd like to transmit binary data from SQL server to client and load it into variable. I used for this Microsoft Internet Transfer Control and my...
    4. Save data to server without postback?
      I have an intranet application where some pages display large tables of editable data. I've designed the page to operate like Microsoft Access...
    5. Run filemaker script on sql server data?
      Hi is it possible to take a sql database, run a filemaker script on the data, and then have it update the sql server data? I'm new at this so...
  3. #2

    Default Re: Save data on server with asp script

    To test your CGI script, make an ordinary html <form> and use use it in a
    browser.
    And I don't think you want "on error resume next" because you want to see every
    error whilst testing.

    Andrew

    Andrew Morton Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139