Linking to a created file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ytoledano@gmail.com

    Linking to a created file

    Hi,
    I'm using PerlScript in my ASP page and I have the following problem:
    Each time the page is refreshed a CSV file is created. I want this file
    to be available for download. The problem is I can't create the file in
    the "wwwroot\si te" dir, so I can't link to it. I can however create
    anywhere else on the server.

    Thanks in advanced.

  • Steven Burn

    #2
    Re: Linking to a created file

    Give this a try;

    <%
    '// incFunctions.as p

    '// Ensure used vars are declared
    Option Explicit

    '// Const for the FileSystemObjec t
    Const c_Read = 1 '// Read a file

    '// Function: ReadFile
    '// Purpose: Read the content of a file
    '//
    '// Usage:
    '//
    '// Dim strData: strData = ReadFile("..\pr ivate\myfile.tx t")
    Function ReadFile(sFile)
    Dim objFSO, objFile '// Declare used vars
    Set objFSO = CreateObject("S cripting.FileSy stemObject")
    Set objFile = objFSO.OpenText File(Server.Map Path(sFile), c_Read)
    ReadFile = objFile.ReadAll ()
    Set objFSO = Nothing '// ALWAYS cleanup
    End Function
    %>

    --
    Regards

    Steven Burn
    Ur I.T. Mate Group


    Keeping it FREE!

    <ytoledano@gmai l.com> wrote in message
    news:1147893586 .436852.67200@g 10g2000cwb.goog legroups.com...[color=blue]
    > Hi,
    > I'm using PerlScript in my ASP page and I have the following problem:
    > Each time the page is refreshed a CSV file is created. I want this file
    > to be available for download. The problem is I can't create the file in
    > the "wwwroot\si te" dir, so I can't link to it. I can however create
    > anywhere else on the server.
    >
    > Thanks in advanced.
    >[/color]


    Comment

    • ytoledano@gmail.com

      #3
      Re: Linking to a created file

      Well, I'm using PerlScript, and also I don't have access to the project
      till Tuesday.
      But I have 2 more questions:
      Could it be because I don't have premssion to write to the wwwroot\site
      folder?
      What permssions does the user which compiles the page have?

      Thanks

      Comment

      • Mike Brind

        #4
        Re: Linking to a created file


        ytoledano@gmail .com wrote:[color=blue]
        > Well, I'm using PerlScript, and also I don't have access to the project
        > till Tuesday.
        > But I have 2 more questions:
        > Could it be because I don't have premssion to write to the wwwroot\site
        > folder?
        > What permssions does the user which compiles the page have?
        >
        > Thanks[/color]

        If you have tried writing to the wwwroot\site directory and received an
        error message about permissions, then you need to ensure that the
        IUSR_machinenam e account has write permissions for that folder.

        --
        Mike Brind

        Comment

        • ytoledano@gmail.com

          #5
          Re: Linking to a created file

          I received no error, the file simply wasn't written there.

          Comment

          • Evertjan.

            #6
            Re: Linking to a created file

            wrote on 18 mei 2006 in microsoft.publi c.inetserver.as p.general:
            [color=blue]
            > I received no error, the file simply wasn't written there.[/color]

            Might we know what you are talking about?


            --
            Evertjan.
            The Netherlands.
            (Please change the x'es to dots in my emailaddress)

            Comment

            • ytoledano@gmail.com

              #7
              Re: Linking to a created file

              The reason I can't link to the file I just created is that I can't
              create it in the wwwroot\site directory. I open the file for writing,
              and then write text into it. When I open the site it loads correctly
              but the file isn't created. Therefore, I receive no error.

              Comment

              • Evertjan.

                #8
                Re: Linking to a created file

                wrote on 18 mei 2006 in microsoft.publi c.inetserver.as p.general:
                [color=blue]
                > The reason I can't link to the file I just created is that I can't
                > create it in the wwwroot\site directory. I open the file for writing,
                > and then write text into it. When I open the site it loads correctly
                > but the file isn't created. Therefore, I receive no error.
                >[/color]

                I still do not know what you are talking about.

                Please quote what you are replying to. If you want to post a followup via
                groups.google.c om, don't use the "Reply" link at the bottom of the article.
                Click on "show options" at the top of the article, then click on the
                "Reply" at the bottom of the article headers.
                <http://www.safalra.com/special/googlegroupsrep ly/>

                --
                Evertjan.
                The Netherlands.
                (Please change the x'es to dots in my emailaddress)

                Comment

                Working...