writing txt file with ASP

Results 1 to 3 of 3

Thread: writing txt file with ASP

  1. #1
    simone grippa Guest

    Default writing txt file with ASP

    I got a problem writing a text file with ASP.<BR>It seems I can&#039t write a file inside the directory where my site is located. <BR>I&#039ve take a look at any kind of permission but I&#039ve not found anything interesting (I can already write inside my site&#039s directory).<BR>Can anybody help me ???????<BR>Thanks.<BR>&#060;-- simone.grippa@sefin.it -->

  2. #2
    Ryan S Guest

    Default RE: writing txt file with ASP

    Well, one option is to read my article @ 4GuysFromRolla.com. After you do that, check the location on where you are specifying the ASP code to write to. Here&#039s an example setup:<BR><BR>virtual path= "/scripts/test"<BR>physical path= "C:Inetpubwwwrootusersmescripts est\"<BR><BR>script name = "/foobar.asp" (that is, root of your user directory)<BR>Text you are trying to write = "foobio.txt"<BR><BR>Now, you have to analyze what you are specifying as the path.If you are trying "/scripts/test/foobio.txt", that will cause trouble. You want to specify an absolute test - Example<BR><BR>Old Code<BR>textFile = "/scripts/test/foobio.txt"<BR><BR>New Code<BR>textFile = Server.MapPath("/scripts/test/foobio.txt")<BR><BR>This way, it specified the full server path for the file you are writing, lending the physical side versus writing the virtual. As you can see, this method will allow for much better stuff. Hope that helps!

  3. #3
    Simone Grippa Guest

    Default RE: writing txt file with ASP

    First I thank you for your prompt reply.<BR>I have read your message @ 4GuysFromRolla.com and other by C.Carroll, but I get the same problem as before: I can write my txt file everywhere on the server&#039s hard disk except 4 the directory where my site is located.<BR>If I try:<BR><BR>set myFile = fso.CreateTextFile ("c:inetpubwwwrootpippo.txt",true)<BR><BR>... everything works fine, but if I try with:<BR><BR>set myFile = fso.CreateTextFile ("c:inetpubwwwrootcbipippo.txt",true)<BR><BR>.. . where "cbi" is the root of my website, I get this error:<BR><BR>Server object error &#039ASP 0177 : 800a0046&#039 <BR>Server.CreateObject Failed <BR>/prova.asp, line 32 <BR><BR>So I can&#039t write inside my site. Is it right? Do you experienced something like that? Maybe can be some kind of permission, but it seems I can write on my site ... as I am the admin.<BR>PS: I have tried also with Server.MapPath ...<BR><BR>Thanks

Posting Permissions

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