Home All Groups Group Topic Archive Search About

Linking to a created file



Author
17 May 2006 7:19 PM
ytoledano
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\site" dir, so I can't link to it. I can however create
anywhere else on the server.

Thanks in advanced.

Author
17 May 2006 8:12 PM
Steven Burn
Give this a try;

<%
    '// incFunctions.asp

    '// Ensure used vars are declared
    Option Explicit

    '// Const for the FileSystemObject
    Const c_Read = 1 '// Read a file

    '// Function: ReadFile
    '// Purpose: Read the content of a file
    '//
    '// Usage:
    '//
    '//        Dim strData: strData = ReadFile("..\private\myfile.txt")
    Function ReadFile(sFile)
        Dim objFSO, objFile '// Declare used vars
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objFile = objFSO.OpenTextFile(Server.MapPath(sFile), c_Read)
        ReadFile = objFile.ReadAll()
        Set objFSO = Nothing '// ALWAYS cleanup
    End Function
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

<ytoled***@gmail.com> wrote in message
Show quote
news:1147893586.436852.67200@g10g2000cwb.googlegroups.com...
> 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\site" dir, so I can't link to it. I can however create
> anywhere else on the server.
>
> Thanks in advanced.
>
Author
17 May 2006 9:41 PM
ytoledano
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
Author
18 May 2006 7:15 AM
Mike Brind
ytoled***@gmail.com wrote:
> 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

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_machinename account has write permissions for that folder.

--
Mike Brind
Author
18 May 2006 11:47 AM
ytoledano
I received no error, the file simply wasn't written there.
Author
18 May 2006 12:03 PM
Evertjan.
wrote on 18 mei 2006 in microsoft.public.inetserver.asp.general:

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

Might we know what you are talking about?


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
18 May 2006 5:40 PM
ytoledano
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.
Author
18 May 2006 7:50 PM
Evertjan.
wrote on 18 mei 2006 in microsoft.public.inetserver.asp.general:

> 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.
>

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.com, 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/googlegroupsreply/>

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

AddThis Social Bookmark Button